Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 1 | //===--- Tools.h - Tool Implementations -------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef CLANG_LIB_DRIVER_TOOLS_H_ |
| 11 | #define CLANG_LIB_DRIVER_TOOLS_H_ |
| 12 | |
| 13 | #include "clang/Driver/Tool.h" |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 14 | #include "clang/Driver/Types.h" |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 15 | #include "clang/Driver/Util.h" |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 16 | |
| 17 | #include "llvm/Support/Compiler.h" |
| 18 | |
| 19 | namespace clang { |
| 20 | namespace driver { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 21 | class Driver; |
| 22 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 23 | namespace toolchains { |
Daniel Dunbar | f0a5b9b | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 24 | class Darwin; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 25 | } |
| 26 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 27 | namespace tools { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 28 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 29 | /// \brief Clang compiler tool. |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 30 | class LLVM_LIBRARY_VISIBILITY Clang : public Tool { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 31 | void AddPreprocessingOptions(const Driver &D, |
| 32 | const ArgList &Args, |
Daniel Dunbar | d067f7f | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 33 | ArgStringList &CmdArgs, |
| 34 | const InputInfo &Output, |
| 35 | const InputInfoList &Inputs) const; |
| 36 | |
Daniel Dunbar | 0f5c542 | 2009-09-10 04:57:17 +0000 | [diff] [blame] | 37 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Eric Christopher | 0b26a61 | 2010-03-02 02:41:08 +0000 | [diff] [blame] | 38 | void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Bruno Cardoso Lopes | e7f211c | 2010-11-09 17:21:19 +0000 | [diff] [blame] | 39 | void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 40 | void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
| 41 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 42 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 43 | Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 44 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 45 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | c434394 | 2010-02-03 03:07:56 +0000 | [diff] [blame] | 46 | virtual bool hasIntegratedAssembler() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 47 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 48 | |
| 49 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 50 | const InputInfo &Output, |
| 51 | const InputInfoList &Inputs, |
| 52 | const ArgList &TCArgs, |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 53 | const char *LinkingOutput) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 54 | }; |
| 55 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 56 | /// \brief Clang integrated assembler tool. |
| 57 | class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { |
| 58 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 59 | ClangAs(const ToolChain &TC) : Tool("clang::as", |
| 60 | "clang integrated assembler", TC) {} |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 61 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 62 | virtual bool hasGoodDiagnostics() const { return true; } |
| 63 | virtual bool hasIntegratedAssembler() const { return false; } |
| 64 | virtual bool hasIntegratedCPP() const { return false; } |
| 65 | |
| 66 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 67 | const InputInfo &Output, |
| 68 | const InputInfoList &Inputs, |
| 69 | const ArgList &TCArgs, |
| 70 | const char *LinkingOutput) const; |
| 71 | }; |
| 72 | |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 73 | /// gcc - Generic GCC tool implementations. |
| 74 | namespace gcc { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 75 | class LLVM_LIBRARY_VISIBILITY Common : public Tool { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 76 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 77 | Common(const char *Name, const char *ShortName, |
| 78 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 79 | |
| 80 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 81 | const InputInfo &Output, |
| 82 | const InputInfoList &Inputs, |
| 83 | const ArgList &TCArgs, |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 84 | const char *LinkingOutput) const; |
| 85 | |
| 86 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 87 | /// the particular tool mode. |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 88 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 89 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 90 | }; |
| 91 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 92 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 93 | class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 94 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 95 | Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", |
| 96 | "gcc preprocessor", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 97 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 98 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 99 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 100 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 101 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 102 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 103 | }; |
| 104 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 105 | class LLVM_LIBRARY_VISIBILITY Precompile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 106 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 107 | Precompile(const ToolChain &TC) : Common("gcc::Precompile", |
| 108 | "gcc precompile", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 109 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 110 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 111 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 112 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 113 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 114 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 115 | }; |
| 116 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 117 | class LLVM_LIBRARY_VISIBILITY Compile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 118 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 119 | Compile(const ToolChain &TC) : Common("gcc::Compile", |
| 120 | "gcc frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 121 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 122 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 123 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 124 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 125 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 126 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 127 | }; |
| 128 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 129 | class LLVM_LIBRARY_VISIBILITY Assemble : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 130 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 131 | Assemble(const ToolChain &TC) : Common("gcc::Assemble", |
| 132 | "assembler (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 133 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 134 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 135 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 136 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 137 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 138 | }; |
| 139 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 140 | class LLVM_LIBRARY_VISIBILITY Link : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 141 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 142 | Link(const ToolChain &TC) : Common("gcc::Link", |
| 143 | "linker (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 144 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 145 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 146 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 147 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 148 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 149 | }; |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 150 | } // end namespace gcc |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 151 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 152 | namespace darwin { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 153 | class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool { |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 154 | protected: |
| 155 | void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 156 | |
| 157 | const toolchains::Darwin &getDarwinToolChain() const { |
| 158 | return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); |
| 159 | } |
| 160 | |
| 161 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 162 | DarwinTool(const char *Name, const char *ShortName, |
| 163 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 164 | }; |
| 165 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 166 | class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool { |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 167 | public: |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 168 | static const char *getBaseInputName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 169 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 170 | static const char *getBaseInputStem(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 171 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 172 | static const char *getDependencyFileName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 173 | const InputInfoList &Inputs); |
| 174 | |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 175 | protected: |
| 176 | const char *getCC1Name(types::ID Type) const; |
| 177 | |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 178 | void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 179 | void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 180 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 181 | const ArgStringList &OutputArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 182 | void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 183 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 184 | const ArgStringList &OutputArgs) const; |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 185 | void AddCPPUniqueOptionsArgs(const ArgList &Args, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 186 | ArgStringList &CmdArgs, |
| 187 | const InputInfoList &Inputs) const; |
| 188 | void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 189 | |
| 190 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 191 | CC1(const char *Name, const char *ShortName, |
| 192 | const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 193 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 194 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 195 | virtual bool hasIntegratedCPP() const { return true; } |
| 196 | }; |
| 197 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 198 | class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 199 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 200 | Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess", |
| 201 | "gcc preprocessor", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 202 | |
| 203 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 204 | const InputInfo &Output, |
| 205 | const InputInfoList &Inputs, |
| 206 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 207 | const char *LinkingOutput) const; |
| 208 | }; |
| 209 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 210 | class LLVM_LIBRARY_VISIBILITY Compile : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 211 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 212 | Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 213 | |
| 214 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 215 | const InputInfo &Output, |
| 216 | const InputInfoList &Inputs, |
| 217 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 218 | const char *LinkingOutput) const; |
| 219 | }; |
| 220 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 221 | class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool { |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 222 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 223 | Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", |
| 224 | "assembler", TC) {} |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 225 | |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 226 | virtual bool hasIntegratedCPP() const { return false; } |
| 227 | |
| 228 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 229 | const InputInfo &Output, |
| 230 | const InputInfoList &Inputs, |
| 231 | const ArgList &TCArgs, |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 232 | const char *LinkingOutput) const; |
| 233 | }; |
| 234 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 235 | class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { |
Daniel Dunbar | ccbc452 | 2010-09-09 21:51:05 +0000 | [diff] [blame] | 236 | void AddLinkArgs(Compilation &C, const ArgList &Args, |
| 237 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 238 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 239 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 240 | Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 241 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 242 | virtual bool hasIntegratedCPP() const { return false; } |
| 243 | |
| 244 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 245 | const InputInfo &Output, |
| 246 | const InputInfoList &Inputs, |
| 247 | const ArgList &TCArgs, |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 248 | const char *LinkingOutput) const; |
| 249 | }; |
| 250 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 251 | class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool { |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 252 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 253 | Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 254 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 255 | virtual bool hasIntegratedCPP() const { return false; } |
| 256 | |
| 257 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 258 | const InputInfo &Output, |
| 259 | const InputInfoList &Inputs, |
| 260 | const ArgList &TCArgs, |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 261 | const char *LinkingOutput) const; |
| 262 | }; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 263 | |
| 264 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool { |
| 265 | public: |
| 266 | Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil", |
| 267 | "dsymutil", TC) {} |
| 268 | |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 269 | virtual bool hasIntegratedCPP() const { return false; } |
| 270 | |
| 271 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 272 | const InputInfo &Output, |
| 273 | const InputInfoList &Inputs, |
| 274 | const ArgList &TCArgs, |
| 275 | const char *LinkingOutput) const; |
| 276 | }; |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 277 | } |
| 278 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 279 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 280 | namespace openbsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 281 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 282 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 283 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler", |
| 284 | TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 285 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 286 | virtual bool hasIntegratedCPP() const { return false; } |
| 287 | |
| 288 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 289 | const InputInfo &Output, |
| 290 | const InputInfoList &Inputs, |
| 291 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 292 | const char *LinkingOutput) const; |
| 293 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 294 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 295 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 296 | Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 297 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 298 | virtual bool hasIntegratedCPP() const { return false; } |
| 299 | |
| 300 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 301 | const InputInfo &Output, |
| 302 | const InputInfoList &Inputs, |
| 303 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 304 | const char *LinkingOutput) const; |
| 305 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 306 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 307 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 308 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 309 | namespace freebsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 310 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 311 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 312 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler", |
| 313 | TC) {} |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 314 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 315 | virtual bool hasIntegratedCPP() const { return false; } |
| 316 | |
| 317 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 318 | const InputInfo &Output, |
| 319 | const InputInfoList &Inputs, |
| 320 | const ArgList &TCArgs, |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 321 | const char *LinkingOutput) const; |
| 322 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 323 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 324 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 325 | Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {} |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 326 | |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 327 | virtual bool hasIntegratedCPP() const { return false; } |
| 328 | |
| 329 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 330 | const InputInfo &Output, |
| 331 | const InputInfoList &Inputs, |
| 332 | const ArgList &TCArgs, |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 333 | const char *LinkingOutput) const; |
| 334 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 335 | } // end namespace freebsd |
| 336 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame^] | 337 | /// netbsd -- Directly call GNU Binutils assembler and linker |
| 338 | namespace netbsd { |
| 339 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 340 | public: |
| 341 | Assemble(const ToolChain &TC) : Tool("netbsd::Assemble", "assembler", |
| 342 | TC) {} |
| 343 | |
| 344 | virtual bool hasIntegratedCPP() const { return false; } |
| 345 | |
| 346 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 347 | const InputInfo &Output, |
| 348 | const InputInfoList &Inputs, |
| 349 | const ArgList &TCArgs, |
| 350 | const char *LinkingOutput) const; |
| 351 | }; |
| 352 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 353 | public: |
| 354 | Link(const ToolChain &TC) : Tool("netbsd::Link", "linker", TC) {} |
| 355 | |
| 356 | virtual bool hasIntegratedCPP() const { return false; } |
| 357 | |
| 358 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 359 | const InputInfo &Output, |
| 360 | const InputInfoList &Inputs, |
| 361 | const ArgList &TCArgs, |
| 362 | const char *LinkingOutput) const; |
| 363 | }; |
| 364 | } // end namespace netbsd |
| 365 | |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 366 | /// linux -- Directly call GNU Binutils assembler and linker |
| 367 | namespace linuxtools { |
| 368 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 369 | public: |
| 370 | Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler", |
| 371 | TC) {} |
| 372 | |
| 373 | virtual bool hasIntegratedCPP() const { return false; } |
| 374 | |
| 375 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 376 | const InputInfo &Output, |
| 377 | const InputInfoList &Inputs, |
| 378 | const ArgList &TCArgs, |
| 379 | const char *LinkingOutput) const; |
| 380 | }; |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 381 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 382 | public: |
| 383 | Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {} |
| 384 | |
| 385 | virtual bool hasIntegratedCPP() const { return false; } |
| 386 | |
| 387 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 388 | const InputInfo &Output, |
| 389 | const InputInfoList &Inputs, |
| 390 | const ArgList &TCArgs, |
| 391 | const char *LinkingOutput) const; |
| 392 | }; |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 393 | } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 394 | /// minix -- Directly call GNU Binutils assembler and linker |
| 395 | namespace minix { |
| 396 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 397 | public: |
| 398 | Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler", |
| 399 | TC) {} |
| 400 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 401 | virtual bool hasIntegratedCPP() const { return false; } |
| 402 | |
| 403 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 404 | const InputInfo &Output, |
| 405 | const InputInfoList &Inputs, |
| 406 | const ArgList &TCArgs, |
| 407 | const char *LinkingOutput) const; |
| 408 | }; |
| 409 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 410 | public: |
| 411 | Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {} |
| 412 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 413 | virtual bool hasIntegratedCPP() const { return false; } |
| 414 | |
| 415 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 416 | const InputInfo &Output, |
| 417 | const InputInfoList &Inputs, |
| 418 | const ArgList &TCArgs, |
| 419 | const char *LinkingOutput) const; |
| 420 | }; |
| 421 | } // end namespace minix |
| 422 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 423 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 424 | namespace auroraux { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 425 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 426 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 427 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler", |
| 428 | TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 429 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 430 | virtual bool hasIntegratedCPP() const { return false; } |
| 431 | |
| 432 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 433 | const InputInfo &Output, |
| 434 | const InputInfoList &Inputs, |
| 435 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 436 | const char *LinkingOutput) const; |
| 437 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 438 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 439 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 440 | Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 441 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 442 | virtual bool hasIntegratedCPP() const { return false; } |
| 443 | |
| 444 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 445 | const InputInfo &Output, |
| 446 | const InputInfoList &Inputs, |
| 447 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 448 | const char *LinkingOutput) const; |
| 449 | }; |
| 450 | } // end namespace auroraux |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 451 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 452 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 453 | namespace dragonfly { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 454 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 455 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 456 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler", |
| 457 | TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 458 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 459 | virtual bool hasIntegratedCPP() const { return false; } |
| 460 | |
| 461 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 462 | const InputInfo &Output, |
| 463 | const InputInfoList &Inputs, |
| 464 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 465 | const char *LinkingOutput) const; |
| 466 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 467 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 468 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 469 | Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 470 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 471 | virtual bool hasIntegratedCPP() const { return false; } |
| 472 | |
| 473 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 474 | const InputInfo &Output, |
| 475 | const InputInfoList &Inputs, |
| 476 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 477 | const char *LinkingOutput) const; |
| 478 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 479 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 480 | |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 481 | /// Visual studio tools. |
| 482 | namespace visualstudio { |
| 483 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 484 | public: |
| 485 | Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} |
| 486 | |
| 487 | virtual bool hasIntegratedCPP() const { return false; } |
| 488 | |
| 489 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 490 | const InputInfo &Output, |
| 491 | const InputInfoList &Inputs, |
| 492 | const ArgList &TCArgs, |
| 493 | const char *LinkingOutput) const; |
| 494 | }; |
| 495 | } // end namespace visualstudio |
| 496 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 497 | } // end namespace toolchains |
| 498 | } // end namespace driver |
| 499 | } // end namespace clang |
| 500 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 501 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |