diff options
author | Douglas Katzman <dougk@google.com> | 2015-06-23 20:42:09 +0000 |
---|---|---|
committer | Douglas Katzman <dougk@google.com> | 2015-06-23 20:42:09 +0000 |
commit | 95354292703ebfd92531f2306ea4356d3a517334 (patch) | |
tree | 292771bf97a3aac725a88bc6bd5949176b8de951 /clang/lib/Driver/Tools.h | |
parent | 49047039b05c605d5f96a4d7b073f85e75de2f8c (diff) | |
download | bcm5719-llvm-95354292703ebfd92531f2306ea4356d3a517334.tar.gz bcm5719-llvm-95354292703ebfd92531f2306ea4356d3a517334.zip |
Pedantically rename all Tool subclasses to be nouns, not verbs. NFC
Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.
Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.
Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.
Differential Revision: http://reviews.llvm.org/D10595
llvm-svn: 240455
Diffstat (limited to 'clang/lib/Driver/Tools.h')
-rw-r--r-- | clang/lib/Driver/Tools.h | 462 |
1 files changed, 231 insertions, 231 deletions
diff --git a/clang/lib/Driver/Tools.h b/clang/lib/Driver/Tools.h index 753f542622f..0a51b94a83e 100644 --- a/clang/lib/Driver/Tools.h +++ b/clang/lib/Driver/Tools.h @@ -32,7 +32,7 @@ namespace toolchains { namespace tools { namespace visualstudio { - class Compile; +class Compiler; } using llvm::opt::ArgStringList; @@ -86,11 +86,14 @@ using llvm::opt::ArgStringList; void AddClangCLArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; - visualstudio::Compile *getCLFallback() const; + visualstudio::Compiler *getCLFallback() const; - mutable std::unique_ptr<visualstudio::Compile> CLFallback; + mutable std::unique_ptr<visualstudio::Compiler> CLFallback; public: + // CAUTION! The first constructor argument ("clang") is not arbitrary, + // as it is for other tools. Some operations on a Tool actually test + // whether that tool is Clang based on the Tool's Name as a string. Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC, RF_Full) {} bool hasGoodDiagnostics() const override { return true; } @@ -148,14 +151,14 @@ namespace gcc { /// RenderExtraToolArgs - Render any arguments necessary to force /// the particular tool mode. virtual void - RenderExtraToolArgs(const JobAction &JA, - llvm::opt::ArgStringList &CmdArgs) const = 0; + RenderExtraToolArgs(const JobAction &JA, + llvm::opt::ArgStringList &CmdArgs) const = 0; }; - class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { + class LLVM_LIBRARY_VISIBILITY Preprocessor : public Common { public: - Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", - "gcc preprocessor", TC) {} + Preprocessor(const ToolChain &TC) + : Common("gcc::Preprocessor", "gcc preprocessor", TC) {} bool hasGoodDiagnostics() const override { return true; } bool hasIntegratedCPP() const override { return false; } @@ -164,10 +167,10 @@ namespace gcc { llvm::opt::ArgStringList &CmdArgs) const override; }; - class LLVM_LIBRARY_VISIBILITY Compile : public Common { + class LLVM_LIBRARY_VISIBILITY Compiler : public Common { public: - Compile(const ToolChain &TC) : Common("gcc::Compile", - "gcc frontend", TC) {} + Compiler(const ToolChain &TC) + : Common("gcc::Compiler", "gcc frontend", TC) {} bool hasGoodDiagnostics() const override { return true; } bool hasIntegratedCPP() const override { return true; } @@ -176,10 +179,10 @@ namespace gcc { llvm::opt::ArgStringList &CmdArgs) const override; }; - class LLVM_LIBRARY_VISIBILITY Link : public Common { + class LLVM_LIBRARY_VISIBILITY Linker : public Common { public: - Link(const ToolChain &TC) : Common("gcc::Link", - "linker (via gcc)", TC) {} + Linker(const ToolChain &TC) + : Common("gcc::Linker", "linker (via gcc)", TC) {} bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } @@ -190,14 +193,15 @@ namespace gcc { } // end namespace gcc namespace hexagon { - // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile. - // We simply use "clang -cc1" for those actions. - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("hexagon::Assemble", - "hexagon-as", TC) {} +// For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile +// and Compile. +// We simply use "clang -cc1" for those actions. +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("hexagon::Assembler", "hexagon-as", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } void RenderExtraToolArgs(const JobAction &JA, llvm::opt::ArgStringList &CmdArgs) const; @@ -205,14 +209,13 @@ namespace hexagon { const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; - }; +}; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("hexagon::Link", - "hexagon-ld", TC) {} +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("hexagon::Linker", "hexagon-ld", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } virtual void RenderExtraToolArgs(const JobAction &JA, @@ -258,11 +261,11 @@ namespace ppc { bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); } - /// cloudabi -- Directly call GNU Binutils linker +/// cloudabi -- Directly call GNU Binutils linker namespace cloudabi { -class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: - Link(const ToolChain &TC) : GnuTool("cloudabi::Link", "linker", TC) {} + Linker(const ToolChain &TC) : GnuTool("cloudabi::Linker", "linker", TC) {} bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } @@ -289,19 +292,19 @@ namespace darwin { } public: - MachOTool( - const char *Name, const char *ShortName, const ToolChain &TC, - ResponseFileSupport ResponseSupport = RF_None, - llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, - const char *ResponseFlag = "@") - : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, - ResponseFlag) {} + MachOTool( + const char *Name, const char *ShortName, const ToolChain &TC, + ResponseFileSupport ResponseSupport = RF_None, + llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, + const char *ResponseFlag = "@") + : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, + ResponseFlag) {} }; - class LLVM_LIBRARY_VISIBILITY Assemble : public MachOTool { + class LLVM_LIBRARY_VISIBILITY Assembler : public MachOTool { public: - Assemble(const ToolChain &TC) : MachOTool("darwin::Assemble", - "assembler", TC) {} + Assembler(const ToolChain &TC) + : MachOTool("darwin::Assembler", "assembler", TC) {} bool hasIntegratedCPP() const override { return false; } @@ -311,16 +314,16 @@ namespace darwin { const char *LinkingOutput) const override; }; - class LLVM_LIBRARY_VISIBILITY Link : public MachOTool { + class LLVM_LIBRARY_VISIBILITY Linker : public MachOTool { bool NeedsTempPath(const InputInfoList &Inputs) const; void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const InputInfoList &Inputs) const; public: - Link(const ToolChain &TC) : MachOTool("darwin::Link", "linker", TC, - RF_FileList, llvm::sys::WEM_UTF8, - "-filelist") {} + Linker(const ToolChain &TC) + : MachOTool("darwin::Linker", "linker", TC, RF_FileList, + llvm::sys::WEM_UTF8, "-filelist") {} bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } @@ -373,27 +376,26 @@ namespace darwin { } - /// openbsd -- Directly call GNU Binutils assembler and linker +/// openbsd -- Directly call GNU Binutils assembler and linker namespace openbsd { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("openbsd::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("openbsd::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("openbsd::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("openbsd::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -402,26 +404,26 @@ namespace openbsd { }; } // end namespace openbsd - /// bitrig -- Directly call GNU Binutils assembler and linker +/// bitrig -- Directly call GNU Binutils assembler and linker namespace bitrig { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("bitrig::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("bitrig::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("bitrig::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("bitrig::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -430,26 +432,26 @@ namespace bitrig { }; } // end namespace bitrig - /// freebsd -- Directly call GNU Binutils assembler and linker +/// freebsd -- Directly call GNU Binutils assembler and linker namespace freebsd { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("freebsd::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("freebsd::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("freebsd::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -458,29 +460,28 @@ namespace freebsd { }; } // end namespace freebsd - /// netbsd -- Directly call GNU Binutils assembler and linker +/// netbsd -- Directly call GNU Binutils assembler and linker namespace netbsd { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { - public: - Assemble(const ToolChain &TC) - : GnuTool("netbsd::Assemble", "assembler", TC) {} +public: + Assembler(const ToolChain &TC) + : GnuTool("netbsd::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { - public: - Link(const ToolChain &TC) - : GnuTool("netbsd::Link", "linker", TC) {} +public: + Linker(const ToolChain &TC) : GnuTool("netbsd::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -489,26 +490,25 @@ namespace netbsd { }; } // end namespace netbsd - /// Directly call GNU Binutils' assembler and linker. +/// Directly call GNU Binutils' assembler and linker. namespace gnutools { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("GNU::Assemble", "assembler", TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) : GnuTool("GNU::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("GNU::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("GNU::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, @@ -516,22 +516,21 @@ namespace gnutools { const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} + } -namespace nacltools { - class LLVM_LIBRARY_VISIBILITY AssembleARM : public gnutools::Assemble { + namespace nacltools { + class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler { public: - AssembleARM(const ToolChain &TC) : gnutools::Assemble(TC) {} + AssemblerARM(const ToolChain &TC) : gnutools::Assembler(TC) {} void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, + const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; - class LLVM_LIBRARY_VISIBILITY Link : public Tool { + class LLVM_LIBRARY_VISIBILITY Linker : public Tool { public: - Link(const ToolChain &TC) : Tool("NaCl::Link", "linker", TC) {} + Linker(const ToolChain &TC) : Tool("NaCl::Linker", "linker", TC) {} bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } @@ -544,27 +543,26 @@ namespace nacltools { }; } - /// minix -- Directly call GNU Binutils assembler and linker +/// minix -- Directly call GNU Binutils assembler and linker namespace minix { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("minix::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("minix::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("minix::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("minix::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, @@ -574,26 +572,26 @@ namespace minix { }; } // end namespace minix - /// solaris -- Directly call Solaris assembler and linker +/// solaris -- Directly call Solaris assembler and linker namespace solaris { - class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { - public: - Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +public: + Assembler(const ToolChain &TC) + : Tool("solaris::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public Tool { - public: - Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +public: + Linker(const ToolChain &TC) : Tool("solaris::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -602,26 +600,26 @@ namespace solaris { }; } // end namespace solaris - /// dragonfly -- Directly call GNU Binutils assembler and linker +/// dragonfly -- Directly call GNU Binutils assembler and linker namespace dragonfly { - class LLVM_LIBRARY_VISIBILITY Assemble : public GnuTool { - public: - Assemble(const ToolChain &TC) : GnuTool("dragonfly::Assemble", "assembler", - TC) {} +class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { +public: + Assembler(const ToolChain &TC) + : GnuTool("dragonfly::Assembler", "assembler", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; - }; - class LLVM_LIBRARY_VISIBILITY Link : public GnuTool { - public: - Link(const ToolChain &TC) : GnuTool("dragonfly::Link", "linker", TC) {} + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +public: + Linker(const ToolChain &TC) : GnuTool("dragonfly::Linker", "linker", TC) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, @@ -633,30 +631,31 @@ namespace dragonfly { /// Visual studio tools. namespace visualstudio { - VersionTuple getMSVCVersion(const Driver *D, const llvm::Triple &Triple, - const llvm::opt::ArgList &Args, - bool IsWindowsMSVC); +VersionTuple getMSVCVersion(const Driver *D, const llvm::Triple &Triple, + const llvm::opt::ArgList &Args, bool IsWindowsMSVC); - class LLVM_LIBRARY_VISIBILITY Link : public Tool { - public: - Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC, - RF_Full, llvm::sys::WEM_UTF16) {} +class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +public: + Linker(const ToolChain &TC) + : Tool("visualstudio::Linker", "linker", TC, RF_Full, + llvm::sys::WEM_UTF16) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; - }; +}; - class LLVM_LIBRARY_VISIBILITY Compile : public Tool { - public: - Compile(const ToolChain &TC) : Tool("visualstudio::Compile", "compiler", TC, - RF_Full, llvm::sys::WEM_UTF16) {} +class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { +public: + Compiler(const ToolChain &TC) + : Tool("visualstudio::Compiler", "compiler", TC, RF_Full, + llvm::sys::WEM_UTF16) {} - bool hasIntegratedAssembler() const override { return true; } + bool hasIntegratedAssembler() const override { return true; } bool hasIntegratedCPP() const override { return true; } bool isLinkJob() const override { return false; } @@ -678,53 +677,54 @@ namespace arm { const llvm::Triple &Triple); } namespace XCore { - // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and Compile. - // We simply use "clang -cc1" for those actions. - class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { - public: - Assemble(const ToolChain &TC) : Tool("XCore::Assemble", - "XCore-as", TC) {} +// For XCore, we do not need to instantiate tools for PreProcess, PreCompile and +// Compile. +// We simply use "clang -cc1" for those actions. +class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +public: + Assembler(const ToolChain &TC) : Tool("XCore::Assembler", "XCore-as", TC) {} - bool hasIntegratedCPP() const override { return false; } + bool hasIntegratedCPP() const override { return false; } + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; + +class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +public: + Linker(const ToolChain &TC) : Tool("XCore::Linker", "XCore-ld", TC) {} + + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + } // end namespace XCore. - class LLVM_LIBRARY_VISIBILITY Link : public Tool { + namespace CrossWindows { + class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { public: - Link(const ToolChain &TC) : Tool("XCore::Link", - "XCore-ld", TC) {} + Assembler(const ToolChain &TC) + : Tool("CrossWindows::Assembler", "as", TC) {} bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} // end namespace XCore. -namespace CrossWindows { -class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { -public: - Assemble(const ToolChain &TC) : Tool("CrossWindows::Assemble", "as", TC) { } - - bool hasIntegratedCPP() const override { return false; } - - void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const override; -}; - -class LLVM_LIBRARY_VISIBILITY Link : public Tool { -public: - Link(const ToolChain &TC) : Tool("CrossWindows::Link", "ld", TC, RF_Full) {} + class LLVM_LIBRARY_VISIBILITY Linker : public Tool { + public: + Linker(const ToolChain &TC) + : Tool("CrossWindows::Linker", "ld", TC, RF_Full) {} - bool hasIntegratedCPP() const override { return false; } - bool isLinkJob() const override { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, @@ -735,9 +735,9 @@ public: /// SHAVE tools -- Directly call moviCompile and moviAsm namespace SHAVE { -class LLVM_LIBRARY_VISIBILITY Compile : public Tool { +class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { public: - Compile(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {} + Compiler(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {} bool hasIntegratedCPP() const override { return true; } @@ -747,9 +747,9 @@ public: const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { public: - Assemble(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {} + Assembler(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {} bool hasIntegratedCPP() const override { return false; } // not sure. |