1f4a2713aSLionel Sambuc //===--- Tools.h - Tool Implementations -------------------------*- C++ -*-===// 2f4a2713aSLionel Sambuc // 3f4a2713aSLionel Sambuc // The LLVM Compiler Infrastructure 4f4a2713aSLionel Sambuc // 5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source 6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details. 7f4a2713aSLionel Sambuc // 8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===// 9f4a2713aSLionel Sambuc 10*0a6a1f1dSLionel Sambuc #ifndef LLVM_CLANG_LIB_DRIVER_TOOLS_H 11*0a6a1f1dSLionel Sambuc #define LLVM_CLANG_LIB_DRIVER_TOOLS_H 12f4a2713aSLionel Sambuc 13f4a2713aSLionel Sambuc #include "clang/Driver/Tool.h" 14f4a2713aSLionel Sambuc #include "clang/Driver/Types.h" 15f4a2713aSLionel Sambuc #include "clang/Driver/Util.h" 16f4a2713aSLionel Sambuc #include "llvm/ADT/Triple.h" 17f4a2713aSLionel Sambuc #include "llvm/Option/Option.h" 18f4a2713aSLionel Sambuc #include "llvm/Support/Compiler.h" 19f4a2713aSLionel Sambuc 20f4a2713aSLionel Sambuc namespace clang { 21f4a2713aSLionel Sambuc class ObjCRuntime; 22f4a2713aSLionel Sambuc 23f4a2713aSLionel Sambuc namespace driver { 24f4a2713aSLionel Sambuc class Command; 25f4a2713aSLionel Sambuc class Driver; 26f4a2713aSLionel Sambuc 27f4a2713aSLionel Sambuc namespace toolchains { 28*0a6a1f1dSLionel Sambuc class MachO; 29f4a2713aSLionel Sambuc } 30f4a2713aSLionel Sambuc 31f4a2713aSLionel Sambuc namespace tools { 32*0a6a1f1dSLionel Sambuc 33*0a6a1f1dSLionel Sambuc namespace visualstudio { 34*0a6a1f1dSLionel Sambuc class Compile; 35*0a6a1f1dSLionel Sambuc } 36*0a6a1f1dSLionel Sambuc 37f4a2713aSLionel Sambuc using llvm::opt::ArgStringList; 38f4a2713aSLionel Sambuc 39f4a2713aSLionel Sambuc /// \brief Clang compiler tool. 40f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Clang : public Tool { 41f4a2713aSLionel Sambuc public: 42f4a2713aSLionel Sambuc static const char *getBaseInputName(const llvm::opt::ArgList &Args, 43f4a2713aSLionel Sambuc const InputInfoList &Inputs); 44f4a2713aSLionel Sambuc static const char *getBaseInputStem(const llvm::opt::ArgList &Args, 45f4a2713aSLionel Sambuc const InputInfoList &Inputs); 46f4a2713aSLionel Sambuc static const char *getDependencyFileName(const llvm::opt::ArgList &Args, 47f4a2713aSLionel Sambuc const InputInfoList &Inputs); 48f4a2713aSLionel Sambuc 49f4a2713aSLionel Sambuc private: 50f4a2713aSLionel Sambuc void AddPreprocessingOptions(Compilation &C, const JobAction &JA, 51f4a2713aSLionel Sambuc const Driver &D, 52f4a2713aSLionel Sambuc const llvm::opt::ArgList &Args, 53f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs, 54f4a2713aSLionel Sambuc const InputInfo &Output, 55f4a2713aSLionel Sambuc const InputInfoList &Inputs) const; 56f4a2713aSLionel Sambuc 57f4a2713aSLionel Sambuc void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, 58f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 59f4a2713aSLionel Sambuc void AddARMTargetArgs(const llvm::opt::ArgList &Args, 60f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs, 61f4a2713aSLionel Sambuc bool KernelOrKext) const; 62*0a6a1f1dSLionel Sambuc void AddARM64TargetArgs(const llvm::opt::ArgList &Args, 63*0a6a1f1dSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 64f4a2713aSLionel Sambuc void AddMIPSTargetArgs(const llvm::opt::ArgList &Args, 65f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 66*0a6a1f1dSLionel Sambuc void AddPPCTargetArgs(const llvm::opt::ArgList &Args, 67*0a6a1f1dSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 68f4a2713aSLionel Sambuc void AddR600TargetArgs(const llvm::opt::ArgList &Args, 69f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 70f4a2713aSLionel Sambuc void AddSparcTargetArgs(const llvm::opt::ArgList &Args, 71f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 72f4a2713aSLionel Sambuc void AddSystemZTargetArgs(const llvm::opt::ArgList &Args, 73f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 74f4a2713aSLionel Sambuc void AddX86TargetArgs(const llvm::opt::ArgList &Args, 75f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 76f4a2713aSLionel Sambuc void AddHexagonTargetArgs(const llvm::opt::ArgList &Args, 77f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 78f4a2713aSLionel Sambuc 79f4a2713aSLionel Sambuc enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile }; 80f4a2713aSLionel Sambuc 81f4a2713aSLionel Sambuc ObjCRuntime AddObjCRuntimeArgs(const llvm::opt::ArgList &args, 82f4a2713aSLionel Sambuc llvm::opt::ArgStringList &cmdArgs, 83f4a2713aSLionel Sambuc RewriteKind rewrite) const; 84f4a2713aSLionel Sambuc 85f4a2713aSLionel Sambuc void AddClangCLArgs(const llvm::opt::ArgList &Args, 86f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 87f4a2713aSLionel Sambuc 88*0a6a1f1dSLionel Sambuc visualstudio::Compile *getCLFallback() const; 89*0a6a1f1dSLionel Sambuc 90*0a6a1f1dSLionel Sambuc mutable std::unique_ptr<visualstudio::Compile> CLFallback; 91*0a6a1f1dSLionel Sambuc 92f4a2713aSLionel Sambuc public: Clang(const ToolChain & TC)93*0a6a1f1dSLionel Sambuc Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC, RF_Full) {} 94f4a2713aSLionel Sambuc hasGoodDiagnostics()95*0a6a1f1dSLionel Sambuc bool hasGoodDiagnostics() const override { return true; } hasIntegratedAssembler()96*0a6a1f1dSLionel Sambuc bool hasIntegratedAssembler() const override { return true; } hasIntegratedCPP()97*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return true; } canEmitIR()98*0a6a1f1dSLionel Sambuc bool canEmitIR() const override { return true; } 99f4a2713aSLionel Sambuc 100*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 101*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 102f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 103*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 104f4a2713aSLionel Sambuc }; 105f4a2713aSLionel Sambuc 106f4a2713aSLionel Sambuc /// \brief Clang integrated assembler tool. 107f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { 108f4a2713aSLionel Sambuc public: ClangAs(const ToolChain & TC)109f4a2713aSLionel Sambuc ClangAs(const ToolChain &TC) : Tool("clang::as", 110*0a6a1f1dSLionel Sambuc "clang integrated assembler", TC, 111*0a6a1f1dSLionel Sambuc RF_Full) {} 112f4a2713aSLionel Sambuc hasGoodDiagnostics()113*0a6a1f1dSLionel Sambuc bool hasGoodDiagnostics() const override { return true; } hasIntegratedAssembler()114*0a6a1f1dSLionel Sambuc bool hasIntegratedAssembler() const override { return false; } hasIntegratedCPP()115*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 116f4a2713aSLionel Sambuc 117*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 118*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 119f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 120*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 121*0a6a1f1dSLionel Sambuc }; 122*0a6a1f1dSLionel Sambuc 123*0a6a1f1dSLionel Sambuc /// \brief Base class for all GNU tools that provide the same behavior when 124*0a6a1f1dSLionel Sambuc /// it comes to response files support 125*0a6a1f1dSLionel Sambuc class GnuTool : public Tool { 126*0a6a1f1dSLionel Sambuc virtual void anchor(); 127*0a6a1f1dSLionel Sambuc 128*0a6a1f1dSLionel Sambuc public: GnuTool(const char * Name,const char * ShortName,const ToolChain & TC)129*0a6a1f1dSLionel Sambuc GnuTool(const char *Name, const char *ShortName, const ToolChain &TC) 130*0a6a1f1dSLionel Sambuc : Tool(Name, ShortName, TC, RF_Full, llvm::sys::WEM_CurrentCodePage) {} 131f4a2713aSLionel Sambuc }; 132f4a2713aSLionel Sambuc 133f4a2713aSLionel Sambuc /// gcc - Generic GCC tool implementations. 134f4a2713aSLionel Sambuc namespace gcc { 135*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Common : public GnuTool { 136f4a2713aSLionel Sambuc public: Common(const char * Name,const char * ShortName,const ToolChain & TC)137f4a2713aSLionel Sambuc Common(const char *Name, const char *ShortName, 138*0a6a1f1dSLionel Sambuc const ToolChain &TC) : GnuTool(Name, ShortName, TC) {} 139f4a2713aSLionel Sambuc 140*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 141f4a2713aSLionel Sambuc const InputInfo &Output, 142f4a2713aSLionel Sambuc const InputInfoList &Inputs, 143f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 144*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 145f4a2713aSLionel Sambuc 146f4a2713aSLionel Sambuc /// RenderExtraToolArgs - Render any arguments necessary to force 147f4a2713aSLionel Sambuc /// the particular tool mode. 148f4a2713aSLionel Sambuc virtual void 149f4a2713aSLionel Sambuc RenderExtraToolArgs(const JobAction &JA, 150f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const = 0; 151f4a2713aSLionel Sambuc }; 152f4a2713aSLionel Sambuc 153f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { 154f4a2713aSLionel Sambuc public: Preprocess(const ToolChain & TC)155f4a2713aSLionel Sambuc Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", 156f4a2713aSLionel Sambuc "gcc preprocessor", TC) {} 157f4a2713aSLionel Sambuc hasGoodDiagnostics()158*0a6a1f1dSLionel Sambuc bool hasGoodDiagnostics() const override { return true; } hasIntegratedCPP()159*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 160f4a2713aSLionel Sambuc 161*0a6a1f1dSLionel Sambuc void RenderExtraToolArgs(const JobAction &JA, 162*0a6a1f1dSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const override; 163f4a2713aSLionel Sambuc }; 164f4a2713aSLionel Sambuc 165f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Compile : public Common { 166f4a2713aSLionel Sambuc public: Compile(const ToolChain & TC)167f4a2713aSLionel Sambuc Compile(const ToolChain &TC) : Common("gcc::Compile", 168f4a2713aSLionel Sambuc "gcc frontend", TC) {} 169f4a2713aSLionel Sambuc hasGoodDiagnostics()170*0a6a1f1dSLionel Sambuc bool hasGoodDiagnostics() const override { return true; } hasIntegratedCPP()171*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return true; } 172f4a2713aSLionel Sambuc 173*0a6a1f1dSLionel Sambuc void RenderExtraToolArgs(const JobAction &JA, 174*0a6a1f1dSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const override; 175f4a2713aSLionel Sambuc }; 176f4a2713aSLionel Sambuc 177f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public Common { 178f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)179f4a2713aSLionel Sambuc Link(const ToolChain &TC) : Common("gcc::Link", 180f4a2713aSLionel Sambuc "linker (via gcc)", TC) {} 181f4a2713aSLionel Sambuc hasIntegratedCPP()182*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()183*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 184f4a2713aSLionel Sambuc 185*0a6a1f1dSLionel Sambuc void RenderExtraToolArgs(const JobAction &JA, 186*0a6a1f1dSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const override; 187f4a2713aSLionel Sambuc }; 188f4a2713aSLionel Sambuc } // end namespace gcc 189f4a2713aSLionel Sambuc 190f4a2713aSLionel Sambuc namespace hexagon { 191f4a2713aSLionel Sambuc // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile. 192f4a2713aSLionel Sambuc // We simply use "clang -cc1" for those actions. 193*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 194f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)195*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("hexagon::Assemble", 196f4a2713aSLionel Sambuc "hexagon-as", TC) {} 197f4a2713aSLionel Sambuc hasIntegratedCPP()198*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 199f4a2713aSLionel Sambuc 200*0a6a1f1dSLionel Sambuc void RenderExtraToolArgs(const JobAction &JA, 201f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 202*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 203*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 204f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 205*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 206f4a2713aSLionel Sambuc }; 207f4a2713aSLionel Sambuc 208*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 209f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)210*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("hexagon::Link", 211f4a2713aSLionel Sambuc "hexagon-ld", TC) {} 212f4a2713aSLionel Sambuc hasIntegratedCPP()213*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()214*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 215f4a2713aSLionel Sambuc 216f4a2713aSLionel Sambuc virtual void RenderExtraToolArgs(const JobAction &JA, 217f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 218*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 219*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 220f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 221*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 222f4a2713aSLionel Sambuc }; 223f4a2713aSLionel Sambuc } // end namespace hexagon. 224f4a2713aSLionel Sambuc 225*0a6a1f1dSLionel Sambuc namespace arm { 226*0a6a1f1dSLionel Sambuc StringRef getARMTargetCPU(const llvm::opt::ArgList &Args, 227*0a6a1f1dSLionel Sambuc const llvm::Triple &Triple); 228*0a6a1f1dSLionel Sambuc const char* getARMCPUForMArch(const llvm::opt::ArgList &Args, 229*0a6a1f1dSLionel Sambuc const llvm::Triple &Triple); 230*0a6a1f1dSLionel Sambuc const char* getLLVMArchSuffixForARM(StringRef CPU); 231*0a6a1f1dSLionel Sambuc 232*0a6a1f1dSLionel Sambuc void appendEBLinkFlags(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple); 233*0a6a1f1dSLionel Sambuc } 234*0a6a1f1dSLionel Sambuc 235*0a6a1f1dSLionel Sambuc namespace mips { 236*0a6a1f1dSLionel Sambuc void getMipsCPUAndABI(const llvm::opt::ArgList &Args, 237*0a6a1f1dSLionel Sambuc const llvm::Triple &Triple, StringRef &CPUName, 238*0a6a1f1dSLionel Sambuc StringRef &ABIName); 239*0a6a1f1dSLionel Sambuc bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value); 240*0a6a1f1dSLionel Sambuc bool isUCLibc(const llvm::opt::ArgList &Args); 241*0a6a1f1dSLionel Sambuc bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple); 242*0a6a1f1dSLionel Sambuc bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName, 243*0a6a1f1dSLionel Sambuc StringRef ABIName); 244*0a6a1f1dSLionel Sambuc } 245*0a6a1f1dSLionel Sambuc 246*0a6a1f1dSLionel Sambuc namespace ppc { 247*0a6a1f1dSLionel Sambuc bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); 248*0a6a1f1dSLionel Sambuc } 249f4a2713aSLionel Sambuc 250f4a2713aSLionel Sambuc namespace darwin { 251*0a6a1f1dSLionel Sambuc llvm::Triple::ArchType getArchTypeForMachOArchName(StringRef Str); 252*0a6a1f1dSLionel Sambuc void setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str); 253f4a2713aSLionel Sambuc 254*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY MachOTool : public Tool { 255f4a2713aSLionel Sambuc virtual void anchor(); 256f4a2713aSLionel Sambuc protected: 257*0a6a1f1dSLionel Sambuc void AddMachOArch(const llvm::opt::ArgList &Args, 258f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs) const; 259f4a2713aSLionel Sambuc getMachOToolChain()260*0a6a1f1dSLionel Sambuc const toolchains::MachO &getMachOToolChain() const { 261*0a6a1f1dSLionel Sambuc return reinterpret_cast<const toolchains::MachO&>(getToolChain()); 262f4a2713aSLionel Sambuc } 263f4a2713aSLionel Sambuc 264f4a2713aSLionel Sambuc public: 265*0a6a1f1dSLionel Sambuc MachOTool( 266*0a6a1f1dSLionel Sambuc const char *Name, const char *ShortName, const ToolChain &TC, 267*0a6a1f1dSLionel Sambuc ResponseFileSupport ResponseSupport = RF_None, 268*0a6a1f1dSLionel Sambuc llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, 269*0a6a1f1dSLionel Sambuc const char *ResponseFlag = "@") Tool(Name,ShortName,TC,ResponseSupport,ResponseEncoding,ResponseFlag)270*0a6a1f1dSLionel Sambuc : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, 271*0a6a1f1dSLionel Sambuc ResponseFlag) {} 272f4a2713aSLionel Sambuc }; 273f4a2713aSLionel Sambuc 274*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public MachOTool { 275f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)276*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : MachOTool("darwin::Assemble", 277f4a2713aSLionel Sambuc "assembler", TC) {} 278f4a2713aSLionel Sambuc hasIntegratedCPP()279*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 280f4a2713aSLionel Sambuc 281*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 282*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 283f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 284*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 285f4a2713aSLionel Sambuc }; 286f4a2713aSLionel Sambuc 287*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public MachOTool { 288f4a2713aSLionel Sambuc bool NeedsTempPath(const InputInfoList &Inputs) const; 289f4a2713aSLionel Sambuc void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, 290f4a2713aSLionel Sambuc llvm::opt::ArgStringList &CmdArgs, 291f4a2713aSLionel Sambuc const InputInfoList &Inputs) const; 292f4a2713aSLionel Sambuc 293f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)294*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : MachOTool("darwin::Link", "linker", TC, 295*0a6a1f1dSLionel Sambuc RF_FileList, llvm::sys::WEM_UTF8, 296*0a6a1f1dSLionel Sambuc "-filelist") {} 297f4a2713aSLionel Sambuc hasIntegratedCPP()298*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()299*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 300f4a2713aSLionel Sambuc 301*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 302*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 303f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 304*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 305f4a2713aSLionel Sambuc }; 306f4a2713aSLionel Sambuc 307*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool { 308f4a2713aSLionel Sambuc public: Lipo(const ToolChain & TC)309*0a6a1f1dSLionel Sambuc Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {} 310f4a2713aSLionel Sambuc hasIntegratedCPP()311*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 312f4a2713aSLionel Sambuc 313*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 314*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 315f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 316*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 317f4a2713aSLionel Sambuc }; 318f4a2713aSLionel Sambuc 319*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool { 320f4a2713aSLionel Sambuc public: Dsymutil(const ToolChain & TC)321*0a6a1f1dSLionel Sambuc Dsymutil(const ToolChain &TC) : MachOTool("darwin::Dsymutil", 322f4a2713aSLionel Sambuc "dsymutil", TC) {} 323f4a2713aSLionel Sambuc hasIntegratedCPP()324*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isDsymutilJob()325*0a6a1f1dSLionel Sambuc bool isDsymutilJob() const override { return true; } 326f4a2713aSLionel Sambuc 327*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 328f4a2713aSLionel Sambuc const InputInfo &Output, 329f4a2713aSLionel Sambuc const InputInfoList &Inputs, 330f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 331*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 332f4a2713aSLionel Sambuc }; 333f4a2713aSLionel Sambuc 334*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool { 335f4a2713aSLionel Sambuc public: VerifyDebug(const ToolChain & TC)336*0a6a1f1dSLionel Sambuc VerifyDebug(const ToolChain &TC) : MachOTool("darwin::VerifyDebug", 337f4a2713aSLionel Sambuc "dwarfdump", TC) {} 338f4a2713aSLionel Sambuc hasIntegratedCPP()339*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 340f4a2713aSLionel Sambuc 341*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 342*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 343f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 344*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 345f4a2713aSLionel Sambuc }; 346f4a2713aSLionel Sambuc 347f4a2713aSLionel Sambuc } 348f4a2713aSLionel Sambuc 349f4a2713aSLionel Sambuc /// openbsd -- Directly call GNU Binutils assembler and linker 350f4a2713aSLionel Sambuc namespace openbsd { 351*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 352f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)353*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("openbsd::Assemble", "assembler", 354f4a2713aSLionel Sambuc TC) {} 355f4a2713aSLionel Sambuc hasIntegratedCPP()356*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 357f4a2713aSLionel Sambuc 358*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 359f4a2713aSLionel Sambuc const InputInfo &Output, 360f4a2713aSLionel Sambuc const InputInfoList &Inputs, 361f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 362*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 363f4a2713aSLionel Sambuc }; 364*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 365f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)366*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("openbsd::Link", "linker", TC) {} 367f4a2713aSLionel Sambuc hasIntegratedCPP()368*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()369*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 370f4a2713aSLionel Sambuc 371*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 372*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 373f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 374*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 375f4a2713aSLionel Sambuc }; 376f4a2713aSLionel Sambuc } // end namespace openbsd 377f4a2713aSLionel Sambuc 378f4a2713aSLionel Sambuc /// bitrig -- Directly call GNU Binutils assembler and linker 379f4a2713aSLionel Sambuc namespace bitrig { 380*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 381f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)382*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("bitrig::Assemble", "assembler", 383f4a2713aSLionel Sambuc TC) {} 384f4a2713aSLionel Sambuc hasIntegratedCPP()385*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 386f4a2713aSLionel Sambuc 387*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 388*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 389f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 390*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 391f4a2713aSLionel Sambuc }; 392*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 393f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)394*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("bitrig::Link", "linker", TC) {} 395f4a2713aSLionel Sambuc hasIntegratedCPP()396*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()397*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 398f4a2713aSLionel Sambuc 399*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 400*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 401f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 402*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 403f4a2713aSLionel Sambuc }; 404f4a2713aSLionel Sambuc } // end namespace bitrig 405f4a2713aSLionel Sambuc 406f4a2713aSLionel Sambuc /// freebsd -- Directly call GNU Binutils assembler and linker 407f4a2713aSLionel Sambuc namespace freebsd { 408*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 409f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)410*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("freebsd::Assemble", "assembler", 411f4a2713aSLionel Sambuc TC) {} 412f4a2713aSLionel Sambuc hasIntegratedCPP()413*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 414f4a2713aSLionel Sambuc 415*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 416*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 417f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 418*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 419f4a2713aSLionel Sambuc }; 420*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 421f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)422*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("freebsd::Link", "linker", TC) {} 423f4a2713aSLionel Sambuc hasIntegratedCPP()424*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()425*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 426f4a2713aSLionel Sambuc 427*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 428*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 429f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 430*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 431f4a2713aSLionel Sambuc }; 432f4a2713aSLionel Sambuc } // end namespace freebsd 433f4a2713aSLionel Sambuc 434f4a2713aSLionel Sambuc /// netbsd -- Directly call GNU Binutils assembler and linker 435f4a2713aSLionel Sambuc namespace netbsd { 436*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 437f4a2713aSLionel Sambuc 438f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)439f4a2713aSLionel Sambuc Assemble(const ToolChain &TC) 440*0a6a1f1dSLionel Sambuc : GnuTool("netbsd::Assemble", "assembler", TC) {} 441f4a2713aSLionel Sambuc hasIntegratedCPP()442*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 443f4a2713aSLionel Sambuc 444*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 445*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 446f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 447*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 448f4a2713aSLionel Sambuc }; 449*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 450f4a2713aSLionel Sambuc 451f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)452f4a2713aSLionel Sambuc Link(const ToolChain &TC) 453*0a6a1f1dSLionel Sambuc : GnuTool("netbsd::Link", "linker", TC) {} 454f4a2713aSLionel Sambuc hasIntegratedCPP()455*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()456*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 457f4a2713aSLionel Sambuc 458*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 459*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 460f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 461*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 462f4a2713aSLionel Sambuc }; 463f4a2713aSLionel Sambuc } // end namespace netbsd 464f4a2713aSLionel Sambuc 465f4a2713aSLionel Sambuc /// Directly call GNU Binutils' assembler and linker. 466f4a2713aSLionel Sambuc namespace gnutools { 467*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 468f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)469*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("GNU::Assemble", "assembler", TC) {} 470f4a2713aSLionel Sambuc hasIntegratedCPP()471*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 472f4a2713aSLionel Sambuc 473*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 474f4a2713aSLionel Sambuc const InputInfo &Output, 475f4a2713aSLionel Sambuc const InputInfoList &Inputs, 476f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 477*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 478f4a2713aSLionel Sambuc }; 479*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 480f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)481*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("GNU::Link", "linker", TC) {} 482f4a2713aSLionel Sambuc hasIntegratedCPP()483*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()484*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 485f4a2713aSLionel Sambuc 486*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 487f4a2713aSLionel Sambuc const InputInfo &Output, 488f4a2713aSLionel Sambuc const InputInfoList &Inputs, 489f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 490*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 491f4a2713aSLionel Sambuc }; 492f4a2713aSLionel Sambuc } 493f4a2713aSLionel Sambuc /// minix -- Directly call GNU Binutils assembler and linker 494f4a2713aSLionel Sambuc namespace minix { 495*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 496f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)497*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("minix::Assemble", "assembler", 498*0a6a1f1dSLionel Sambuc TC) {} 499f4a2713aSLionel Sambuc hasIntegratedCPP()500*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 501f4a2713aSLionel Sambuc 502*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 503f4a2713aSLionel Sambuc const InputInfo &Output, 504f4a2713aSLionel Sambuc const InputInfoList &Inputs, 505f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 506*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 507f4a2713aSLionel Sambuc }; 508*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 509f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)510*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("minix::Link", "linker", TC) {} 511f4a2713aSLionel Sambuc hasIntegratedCPP()512*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()513*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 514f4a2713aSLionel Sambuc 515*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 516f4a2713aSLionel Sambuc const InputInfo &Output, 517f4a2713aSLionel Sambuc const InputInfoList &Inputs, 518f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 519*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 520f4a2713aSLionel Sambuc }; 521f4a2713aSLionel Sambuc } // end namespace minix 522f4a2713aSLionel Sambuc 523f4a2713aSLionel Sambuc /// solaris -- Directly call Solaris assembler and linker 524f4a2713aSLionel Sambuc namespace solaris { 525f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { 526f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)527f4a2713aSLionel Sambuc Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", 528f4a2713aSLionel Sambuc TC) {} 529f4a2713aSLionel Sambuc hasIntegratedCPP()530*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 531f4a2713aSLionel Sambuc 532*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 533*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 534f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 535*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 536f4a2713aSLionel Sambuc }; 537f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public Tool { 538f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)539f4a2713aSLionel Sambuc Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} 540f4a2713aSLionel Sambuc hasIntegratedCPP()541*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()542*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 543f4a2713aSLionel Sambuc 544*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 545*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 546f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 547*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 548f4a2713aSLionel Sambuc }; 549f4a2713aSLionel Sambuc } // end namespace solaris 550f4a2713aSLionel Sambuc 551f4a2713aSLionel Sambuc /// dragonfly -- Directly call GNU Binutils assembler and linker 552f4a2713aSLionel Sambuc namespace dragonfly { 553*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { 554f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)555*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : GnuTool("dragonfly::Assemble", "assembler", 556f4a2713aSLionel Sambuc TC) {} 557f4a2713aSLionel Sambuc hasIntegratedCPP()558*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 559f4a2713aSLionel Sambuc 560*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 561*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 562f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 563*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 564f4a2713aSLionel Sambuc }; 565*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { 566f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)567*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : GnuTool("dragonfly::Link", "linker", TC) {} 568f4a2713aSLionel Sambuc hasIntegratedCPP()569*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()570*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 571f4a2713aSLionel Sambuc 572*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 573f4a2713aSLionel Sambuc const InputInfo &Output, 574f4a2713aSLionel Sambuc const InputInfoList &Inputs, 575f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 576*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 577f4a2713aSLionel Sambuc }; 578f4a2713aSLionel Sambuc } // end namespace dragonfly 579f4a2713aSLionel Sambuc 580f4a2713aSLionel Sambuc /// Visual studio tools. 581f4a2713aSLionel Sambuc namespace visualstudio { 582f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public Tool { 583f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)584*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC, 585*0a6a1f1dSLionel Sambuc RF_Full, llvm::sys::WEM_UTF16) {} 586f4a2713aSLionel Sambuc hasIntegratedCPP()587*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()588*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 589f4a2713aSLionel Sambuc 590*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 591*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 592f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 593*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 594f4a2713aSLionel Sambuc }; 595f4a2713aSLionel Sambuc 596f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Compile : public Tool { 597f4a2713aSLionel Sambuc public: Compile(const ToolChain & TC)598*0a6a1f1dSLionel Sambuc Compile(const ToolChain &TC) : Tool("visualstudio::Compile", "compiler", TC, 599*0a6a1f1dSLionel Sambuc RF_Full, llvm::sys::WEM_UTF16) {} 600f4a2713aSLionel Sambuc hasIntegratedAssembler()601*0a6a1f1dSLionel Sambuc bool hasIntegratedAssembler() const override { return true; } hasIntegratedCPP()602*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return true; } isLinkJob()603*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return false; } 604f4a2713aSLionel Sambuc 605*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 606*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 607f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 608*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 609f4a2713aSLionel Sambuc 610*0a6a1f1dSLionel Sambuc std::unique_ptr<Command> GetCommand(Compilation &C, const JobAction &JA, 611f4a2713aSLionel Sambuc const InputInfo &Output, 612f4a2713aSLionel Sambuc const InputInfoList &Inputs, 613f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 614f4a2713aSLionel Sambuc const char *LinkingOutput) const; 615f4a2713aSLionel Sambuc }; 616f4a2713aSLionel Sambuc } // end namespace visualstudio 617f4a2713aSLionel Sambuc 618*0a6a1f1dSLionel Sambuc namespace arm { 619*0a6a1f1dSLionel Sambuc StringRef getARMFloatABI(const Driver &D, const llvm::opt::ArgList &Args, 620*0a6a1f1dSLionel Sambuc const llvm::Triple &Triple); 621*0a6a1f1dSLionel Sambuc } 622f4a2713aSLionel Sambuc namespace XCore { 623f4a2713aSLionel Sambuc // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and Compile. 624f4a2713aSLionel Sambuc // We simply use "clang -cc1" for those actions. 625f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { 626f4a2713aSLionel Sambuc public: Assemble(const ToolChain & TC)627f4a2713aSLionel Sambuc Assemble(const ToolChain &TC) : Tool("XCore::Assemble", 628f4a2713aSLionel Sambuc "XCore-as", TC) {} 629f4a2713aSLionel Sambuc hasIntegratedCPP()630*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 631*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 632*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 633f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 634*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 635f4a2713aSLionel Sambuc }; 636f4a2713aSLionel Sambuc 637f4a2713aSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public Tool { 638f4a2713aSLionel Sambuc public: Link(const ToolChain & TC)639f4a2713aSLionel Sambuc Link(const ToolChain &TC) : Tool("XCore::Link", 640f4a2713aSLionel Sambuc "XCore-ld", TC) {} 641f4a2713aSLionel Sambuc hasIntegratedCPP()642*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()643*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 644*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 645*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 646f4a2713aSLionel Sambuc const llvm::opt::ArgList &TCArgs, 647*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 648f4a2713aSLionel Sambuc }; 649f4a2713aSLionel Sambuc } // end namespace XCore. 650f4a2713aSLionel Sambuc 651*0a6a1f1dSLionel Sambuc namespace CrossWindows { 652*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { 653*0a6a1f1dSLionel Sambuc public: Assemble(const ToolChain & TC)654*0a6a1f1dSLionel Sambuc Assemble(const ToolChain &TC) : Tool("CrossWindows::Assemble", "as", TC) { } 655*0a6a1f1dSLionel Sambuc hasIntegratedCPP()656*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } 657*0a6a1f1dSLionel Sambuc 658*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 659*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 660*0a6a1f1dSLionel Sambuc const llvm::opt::ArgList &TCArgs, 661*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 662*0a6a1f1dSLionel Sambuc }; 663*0a6a1f1dSLionel Sambuc 664*0a6a1f1dSLionel Sambuc class LLVM_LIBRARY_VISIBILITY Link : public Tool { 665*0a6a1f1dSLionel Sambuc public: Link(const ToolChain & TC)666*0a6a1f1dSLionel Sambuc Link(const ToolChain &TC) : Tool("CrossWindows::Link", "ld", TC, RF_Full) {} 667*0a6a1f1dSLionel Sambuc hasIntegratedCPP()668*0a6a1f1dSLionel Sambuc bool hasIntegratedCPP() const override { return false; } isLinkJob()669*0a6a1f1dSLionel Sambuc bool isLinkJob() const override { return true; } 670*0a6a1f1dSLionel Sambuc 671*0a6a1f1dSLionel Sambuc void ConstructJob(Compilation &C, const JobAction &JA, 672*0a6a1f1dSLionel Sambuc const InputInfo &Output, const InputInfoList &Inputs, 673*0a6a1f1dSLionel Sambuc const llvm::opt::ArgList &TCArgs, 674*0a6a1f1dSLionel Sambuc const char *LinkingOutput) const override; 675*0a6a1f1dSLionel Sambuc }; 676*0a6a1f1dSLionel Sambuc } 677f4a2713aSLionel Sambuc 678f4a2713aSLionel Sambuc } // end namespace toolchains 679f4a2713aSLionel Sambuc } // end namespace driver 680f4a2713aSLionel Sambuc } // end namespace clang 681f4a2713aSLionel Sambuc 682*0a6a1f1dSLionel Sambuc #endif 683