diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-18 08:07:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-18 08:07:30 +0000 |
commit | b488c1dac8e53206f07103d794a62a3f5012c0f4 (patch) | |
tree | 2508403c66ff8524822cae04497a74e287309e93 /lib/Driver/Tools.h | |
parent | e324ffe33e179f6167d18834e15c48c49e314bb4 (diff) |
Driver: Lift out common GCC tool and implement generic GCC tool
argument translation.
Also, stub out clang tool implementation a bit more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.h')
-rw-r--r-- | lib/Driver/Tools.h | 69 |
1 files changed, 31 insertions, 38 deletions
diff --git a/lib/Driver/Tools.h b/lib/Driver/Tools.h index 83dab0604e..a87a7baec5 100644 --- a/lib/Driver/Tools.h +++ b/lib/Driver/Tools.h @@ -11,6 +11,7 @@ #define CLANG_LIB_DRIVER_TOOLS_H_ #include "clang/Driver/Tool.h" +#include "clang/Driver/Util.h" #include "llvm/Support/Compiler.h" @@ -36,13 +37,9 @@ namespace tools { /// gcc - Generic GCC tool implementations. namespace gcc { - class VISIBILITY_HIDDEN Preprocess : public Tool { + class VISIBILITY_HIDDEN Common : public Tool { public: - Preprocess(const ToolChain &TC) : Tool("gcc::Preprocess", TC) {} - - virtual bool acceptsPipedInput() const { return true; } - virtual bool canPipeOutput() const { return true; } - virtual bool hasIntegratedCPP() const { return false; } + Common(const char *Name, const ToolChain &TC) : Tool(Name, TC) {} virtual void ConstructJob(Compilation &C, const JobAction &JA, Job &Dest, @@ -50,70 +47,66 @@ namespace gcc { const InputInfoList &Inputs, const ArgList &TCArgs, const char *LinkingOutput) const; + + /// RenderExtraToolArgs - Render any arguments necessary to force + /// the particular tool mode. + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const = 0; }; - class VISIBILITY_HIDDEN Precompile : public Tool { + + class VISIBILITY_HIDDEN Preprocess : public Common { public: - Precompile(const ToolChain &TC) : Tool("gcc::Precompile", TC) {} + Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", TC) {} + + virtual bool acceptsPipedInput() const { return true; } + virtual bool canPipeOutput() const { return true; } + virtual bool hasIntegratedCPP() const { return false; } + + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const; + }; + + class VISIBILITY_HIDDEN Precompile : public Common { + public: + Precompile(const ToolChain &TC) : Common("gcc::Precompile", TC) {} virtual bool acceptsPipedInput() const { return true; } virtual bool canPipeOutput() const { return false; } virtual bool hasIntegratedCPP() const { return true; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - Job &Dest, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const; }; - class VISIBILITY_HIDDEN Compile : public Tool { + class VISIBILITY_HIDDEN Compile : public Common { public: - Compile(const ToolChain &TC) : Tool("gcc::Compile", TC) {} + Compile(const ToolChain &TC) : Common("gcc::Compile", TC) {} virtual bool acceptsPipedInput() const { return true; } virtual bool canPipeOutput() const { return true; } virtual bool hasIntegratedCPP() const { return true; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - Job &Dest, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const; }; - class VISIBILITY_HIDDEN Assemble : public Tool { + class VISIBILITY_HIDDEN Assemble : public Common { public: - Assemble(const ToolChain &TC) : Tool("gcc::Assemble", TC) {} + Assemble(const ToolChain &TC) : Common("gcc::Assemble", TC) {} virtual bool acceptsPipedInput() const { return true; } virtual bool canPipeOutput() const { return false; } virtual bool hasIntegratedCPP() const { return false; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - Job &Dest, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const; }; - class VISIBILITY_HIDDEN Link : public Tool { + class VISIBILITY_HIDDEN Link : public Common { public: - Link(const ToolChain &TC) : Tool("gcc::Link", TC) {} + Link(const ToolChain &TC) : Common("gcc::Link", TC) {} virtual bool acceptsPipedInput() const { return false; } virtual bool canPipeOutput() const { return false; } virtual bool hasIntegratedCPP() const { return false; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - Job &Dest, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; + virtual void RenderExtraToolArgs(ArgStringList &CmdArgs) const; }; } // end namespace gcc |