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 | |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/Triple.h" |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Compiler.h" |
| 19 | |
| 20 | namespace clang { |
| 21 | namespace driver { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 22 | class Driver; |
| 23 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 24 | namespace toolchains { |
Daniel Dunbar | f0a5b9b | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 25 | class Darwin; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 26 | } |
| 27 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 28 | namespace tools { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 29 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 30 | /// \brief Clang compiler tool. |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 31 | class LLVM_LIBRARY_VISIBILITY Clang : public Tool { |
Peter Collingbourne | 9b515cb | 2011-11-06 00:40:05 +0000 | [diff] [blame] | 32 | void AddPreprocessingOptions(Compilation &C, |
| 33 | const Driver &D, |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 34 | const ArgList &Args, |
Daniel Dunbar | d067f7f | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 35 | ArgStringList &CmdArgs, |
| 36 | const InputInfo &Output, |
| 37 | const InputInfoList &Inputs) const; |
| 38 | |
Daniel Dunbar | c9388c1 | 2011-03-17 17:10:06 +0000 | [diff] [blame] | 39 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 40 | bool KernelOrKext) const; |
Eric Christopher | 0b26a61 | 2010-03-02 02:41:08 +0000 | [diff] [blame] | 41 | void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Hal Finkel | 8eb5928 | 2012-06-11 22:35:19 +0000 | [diff] [blame] | 42 | void AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Bruno Cardoso Lopes | e7f211c | 2010-11-09 17:21:19 +0000 | [diff] [blame] | 43 | void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 44 | void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 45 | void AddHexagonTargetArgs (const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 46 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 47 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 48 | Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 49 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 50 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | c434394 | 2010-02-03 03:07:56 +0000 | [diff] [blame] | 51 | virtual bool hasIntegratedAssembler() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 52 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 53 | |
| 54 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 55 | const InputInfo &Output, |
| 56 | const InputInfoList &Inputs, |
| 57 | const ArgList &TCArgs, |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 58 | const char *LinkingOutput) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 61 | /// \brief Clang integrated assembler tool. |
| 62 | class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { |
Jim Grosbach | 576452b | 2012-02-10 20:37:10 +0000 | [diff] [blame] | 63 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 64 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 65 | ClangAs(const ToolChain &TC) : Tool("clang::as", |
| 66 | "clang integrated assembler", TC) {} |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 67 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 68 | virtual bool hasGoodDiagnostics() const { return true; } |
| 69 | virtual bool hasIntegratedAssembler() const { return false; } |
| 70 | virtual bool hasIntegratedCPP() const { return false; } |
| 71 | |
| 72 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 73 | const InputInfo &Output, |
| 74 | const InputInfoList &Inputs, |
| 75 | const ArgList &TCArgs, |
| 76 | const char *LinkingOutput) const; |
| 77 | }; |
| 78 | |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 79 | /// gcc - Generic GCC tool implementations. |
| 80 | namespace gcc { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 81 | class LLVM_LIBRARY_VISIBILITY Common : public Tool { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 82 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 83 | Common(const char *Name, const char *ShortName, |
| 84 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 85 | |
| 86 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 87 | const InputInfo &Output, |
| 88 | const InputInfoList &Inputs, |
| 89 | const ArgList &TCArgs, |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 90 | const char *LinkingOutput) const; |
| 91 | |
| 92 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 93 | /// the particular tool mode. |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 94 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 95 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 96 | }; |
| 97 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 98 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 99 | class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 100 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 101 | Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", |
| 102 | "gcc preprocessor", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 103 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 104 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 105 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 106 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 107 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 108 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 109 | }; |
| 110 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 111 | class LLVM_LIBRARY_VISIBILITY Precompile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 112 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 113 | Precompile(const ToolChain &TC) : Common("gcc::Precompile", |
| 114 | "gcc precompile", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 115 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 116 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 117 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 118 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 119 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 120 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 121 | }; |
| 122 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 123 | class LLVM_LIBRARY_VISIBILITY Compile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 124 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 125 | Compile(const ToolChain &TC) : Common("gcc::Compile", |
| 126 | "gcc frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 127 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 128 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 129 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 130 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 131 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 132 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 133 | }; |
| 134 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 135 | class LLVM_LIBRARY_VISIBILITY Assemble : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 136 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 137 | Assemble(const ToolChain &TC) : Common("gcc::Assemble", |
| 138 | "assembler (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 139 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 140 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 141 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 142 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 143 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 144 | }; |
| 145 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 146 | class LLVM_LIBRARY_VISIBILITY Link : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 147 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 148 | Link(const ToolChain &TC) : Common("gcc::Link", |
| 149 | "linker (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 150 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 151 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 152 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 153 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 154 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 155 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 156 | }; |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 157 | } // end namespace gcc |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 158 | |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 159 | namespace hexagon { |
| 160 | // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile. |
| 161 | // We simply use "clang -cc1" for those actions. |
| 162 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 163 | public: |
| 164 | Assemble(const ToolChain &TC) : Tool("hexagon::Assemble", |
| 165 | "hexagon-as", TC) {} |
| 166 | |
| 167 | virtual bool hasIntegratedCPP() const { return false; } |
| 168 | |
| 169 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 170 | ArgStringList &CmdArgs) const; |
| 171 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 172 | const InputInfo &Output, |
| 173 | const InputInfoList &Inputs, |
| 174 | const ArgList &TCArgs, |
| 175 | const char *LinkingOutput) const; |
| 176 | }; |
| 177 | |
| 178 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 179 | public: |
| 180 | Link(const ToolChain &TC) : Tool("hexagon::Link", |
| 181 | "hexagon-ld", TC) {} |
| 182 | |
| 183 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 184 | virtual bool isLinkJob() const { return true; } |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 185 | |
| 186 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 187 | ArgStringList &CmdArgs) const; |
| 188 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 189 | const InputInfo &Output, |
| 190 | const InputInfoList &Inputs, |
| 191 | const ArgList &TCArgs, |
| 192 | const char *LinkingOutput) const; |
| 193 | }; |
| 194 | } // end namespace hexagon. |
| 195 | |
| 196 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 197 | namespace darwin { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 198 | class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool { |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 199 | virtual void anchor(); |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 200 | protected: |
| 201 | void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 202 | |
| 203 | const toolchains::Darwin &getDarwinToolChain() const { |
| 204 | return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); |
| 205 | } |
| 206 | |
| 207 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 208 | DarwinTool(const char *Name, const char *ShortName, |
| 209 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 210 | }; |
| 211 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 212 | class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool { |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 213 | virtual void anchor(); |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 214 | public: |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 215 | static const char *getBaseInputName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 216 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 217 | static const char *getBaseInputStem(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 218 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 219 | static const char *getDependencyFileName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 220 | const InputInfoList &Inputs); |
| 221 | |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 222 | protected: |
| 223 | const char *getCC1Name(types::ID Type) const; |
| 224 | |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 225 | void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const; |
Chad Rosier | bc5ea3d | 2011-08-17 18:24:55 +0000 | [diff] [blame] | 226 | void RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 227 | void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 228 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 229 | const ArgStringList &OutputArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 230 | void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 231 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 232 | const ArgStringList &OutputArgs) const; |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 233 | void AddCPPUniqueOptionsArgs(const ArgList &Args, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 234 | ArgStringList &CmdArgs, |
| 235 | const InputInfoList &Inputs) const; |
| 236 | void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 237 | |
| 238 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 239 | CC1(const char *Name, const char *ShortName, |
| 240 | const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 241 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 242 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 243 | virtual bool hasIntegratedCPP() const { return true; } |
| 244 | }; |
| 245 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 246 | class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 247 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 248 | Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess", |
| 249 | "gcc preprocessor", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 250 | |
| 251 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 252 | const InputInfo &Output, |
| 253 | const InputInfoList &Inputs, |
| 254 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 255 | const char *LinkingOutput) const; |
| 256 | }; |
| 257 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 258 | class LLVM_LIBRARY_VISIBILITY Compile : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 259 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 260 | Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 261 | |
| 262 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 263 | const InputInfo &Output, |
| 264 | const InputInfoList &Inputs, |
| 265 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 266 | const char *LinkingOutput) const; |
| 267 | }; |
| 268 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 269 | class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool { |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 270 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 271 | Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", |
| 272 | "assembler", TC) {} |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 273 | |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 274 | virtual bool hasIntegratedCPP() const { return false; } |
| 275 | |
| 276 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 277 | const InputInfo &Output, |
| 278 | const InputInfoList &Inputs, |
| 279 | const ArgList &TCArgs, |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 280 | const char *LinkingOutput) const; |
| 281 | }; |
| 282 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 283 | class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { |
Daniel Dunbar | ccbc452 | 2010-09-09 21:51:05 +0000 | [diff] [blame] | 284 | void AddLinkArgs(Compilation &C, const ArgList &Args, |
| 285 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 286 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 287 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 288 | Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 289 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 290 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 291 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 292 | |
| 293 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 294 | const InputInfo &Output, |
| 295 | const InputInfoList &Inputs, |
| 296 | const ArgList &TCArgs, |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 297 | const char *LinkingOutput) const; |
| 298 | }; |
| 299 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 300 | class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool { |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 301 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 302 | Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 303 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 304 | virtual bool hasIntegratedCPP() const { return false; } |
| 305 | |
| 306 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 307 | const InputInfo &Output, |
| 308 | const InputInfoList &Inputs, |
| 309 | const ArgList &TCArgs, |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 310 | const char *LinkingOutput) const; |
| 311 | }; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 312 | |
| 313 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool { |
| 314 | public: |
| 315 | Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil", |
| 316 | "dsymutil", TC) {} |
| 317 | |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 318 | virtual bool hasIntegratedCPP() const { return false; } |
| 319 | |
| 320 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 321 | const InputInfo &Output, |
| 322 | const InputInfoList &Inputs, |
| 323 | const ArgList &TCArgs, |
| 324 | const char *LinkingOutput) const; |
| 325 | }; |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 326 | |
| 327 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public DarwinTool { |
| 328 | public: |
| 329 | VerifyDebug(const ToolChain &TC) : DarwinTool("darwin::VerifyDebug", |
| 330 | "dwarfdump", TC) {} |
| 331 | |
| 332 | virtual bool hasIntegratedCPP() const { return false; } |
| 333 | |
| 334 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 335 | const InputInfo &Output, |
| 336 | const InputInfoList &Inputs, |
| 337 | const ArgList &TCArgs, |
| 338 | const char *LinkingOutput) const; |
| 339 | }; |
| 340 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 341 | } |
| 342 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 343 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 344 | namespace openbsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 345 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 346 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 347 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler", |
| 348 | TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 349 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 350 | virtual bool hasIntegratedCPP() const { return false; } |
| 351 | |
| 352 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 353 | const InputInfo &Output, |
| 354 | const InputInfoList &Inputs, |
| 355 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 356 | const char *LinkingOutput) const; |
| 357 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 358 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 359 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 360 | Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 361 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 362 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 363 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 364 | |
| 365 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 366 | const InputInfo &Output, |
| 367 | const InputInfoList &Inputs, |
| 368 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 369 | const char *LinkingOutput) const; |
| 370 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 371 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 372 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 373 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 374 | namespace freebsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 375 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 376 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 377 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler", |
| 378 | TC) {} |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 379 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 380 | virtual bool hasIntegratedCPP() const { return false; } |
| 381 | |
| 382 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 383 | const InputInfo &Output, |
| 384 | const InputInfoList &Inputs, |
| 385 | const ArgList &TCArgs, |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 386 | const char *LinkingOutput) const; |
| 387 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 388 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 389 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 390 | Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {} |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 391 | |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 392 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 393 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 394 | |
| 395 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 396 | const InputInfo &Output, |
| 397 | const InputInfoList &Inputs, |
| 398 | const ArgList &TCArgs, |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 399 | const char *LinkingOutput) const; |
| 400 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 401 | } // end namespace freebsd |
| 402 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 403 | /// netbsd -- Directly call GNU Binutils assembler and linker |
| 404 | namespace netbsd { |
| 405 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 406 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 407 | public: |
Joerg Sonnenberger | d64c60e | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 408 | Assemble(const ToolChain &TC) |
| 409 | : Tool("netbsd::Assemble", "assembler", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 410 | |
| 411 | virtual bool hasIntegratedCPP() const { return false; } |
| 412 | |
| 413 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 414 | const InputInfo &Output, |
| 415 | const InputInfoList &Inputs, |
| 416 | const ArgList &TCArgs, |
| 417 | const char *LinkingOutput) const; |
| 418 | }; |
| 419 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 420 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 421 | public: |
Joerg Sonnenberger | d64c60e | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 422 | Link(const ToolChain &TC) |
| 423 | : Tool("netbsd::Link", "linker", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 424 | |
| 425 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 426 | virtual bool isLinkJob() const { return true; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 427 | |
| 428 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 429 | const InputInfo &Output, |
| 430 | const InputInfoList &Inputs, |
| 431 | const ArgList &TCArgs, |
| 432 | const char *LinkingOutput) const; |
| 433 | }; |
| 434 | } // end namespace netbsd |
| 435 | |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 436 | /// linux -- Directly call GNU Binutils assembler and linker |
| 437 | namespace linuxtools { |
| 438 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 439 | public: |
| 440 | Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler", |
| 441 | TC) {} |
| 442 | |
| 443 | virtual bool hasIntegratedCPP() const { return false; } |
| 444 | |
| 445 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 446 | const InputInfo &Output, |
| 447 | const InputInfoList &Inputs, |
| 448 | const ArgList &TCArgs, |
| 449 | const char *LinkingOutput) const; |
| 450 | }; |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 451 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 452 | public: |
| 453 | Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {} |
| 454 | |
| 455 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 456 | virtual bool isLinkJob() const { return true; } |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 457 | |
| 458 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 459 | const InputInfo &Output, |
| 460 | const InputInfoList &Inputs, |
| 461 | const ArgList &TCArgs, |
| 462 | const char *LinkingOutput) const; |
| 463 | }; |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 464 | } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 465 | /// minix -- Directly call GNU Binutils assembler and linker |
| 466 | namespace minix { |
| 467 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 468 | public: |
| 469 | Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler", |
| 470 | TC) {} |
| 471 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 472 | virtual bool hasIntegratedCPP() const { return false; } |
| 473 | |
| 474 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 475 | const InputInfo &Output, |
| 476 | const InputInfoList &Inputs, |
| 477 | const ArgList &TCArgs, |
| 478 | const char *LinkingOutput) const; |
| 479 | }; |
| 480 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 481 | public: |
| 482 | Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {} |
| 483 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 484 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 485 | virtual bool isLinkJob() const { return true; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 486 | |
| 487 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 488 | const InputInfo &Output, |
| 489 | const InputInfoList &Inputs, |
| 490 | const ArgList &TCArgs, |
| 491 | const char *LinkingOutput) const; |
| 492 | }; |
| 493 | } // end namespace minix |
| 494 | |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 495 | /// solaris -- Directly call Solaris assembler and linker |
| 496 | namespace solaris { |
| 497 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 498 | public: |
| 499 | Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", |
| 500 | TC) {} |
| 501 | |
| 502 | virtual bool hasIntegratedCPP() const { return false; } |
| 503 | |
| 504 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 505 | const InputInfo &Output, |
| 506 | const InputInfoList &Inputs, |
| 507 | const ArgList &TCArgs, |
| 508 | const char *LinkingOutput) const; |
| 509 | }; |
| 510 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 511 | public: |
| 512 | Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} |
| 513 | |
| 514 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 515 | virtual bool isLinkJob() const { return true; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 516 | |
| 517 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 518 | const InputInfo &Output, |
| 519 | const InputInfoList &Inputs, |
| 520 | const ArgList &TCArgs, |
| 521 | const char *LinkingOutput) const; |
| 522 | }; |
David Chisnall | a9ed5d7 | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 523 | } // end namespace solaris |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 524 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 525 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 526 | namespace auroraux { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 527 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 528 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 529 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler", |
| 530 | TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 531 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 532 | virtual bool hasIntegratedCPP() const { return false; } |
| 533 | |
| 534 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 535 | const InputInfo &Output, |
| 536 | const InputInfoList &Inputs, |
| 537 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 538 | const char *LinkingOutput) const; |
| 539 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 540 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 541 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 542 | Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 543 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 544 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 545 | virtual bool isLinkJob() const { return true; } |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 546 | |
| 547 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 548 | const InputInfo &Output, |
| 549 | const InputInfoList &Inputs, |
| 550 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 551 | const char *LinkingOutput) const; |
| 552 | }; |
| 553 | } // end namespace auroraux |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 554 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 555 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 556 | namespace dragonfly { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 557 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 558 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 559 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler", |
| 560 | TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 561 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 562 | virtual bool hasIntegratedCPP() const { return false; } |
| 563 | |
| 564 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 565 | const InputInfo &Output, |
| 566 | const InputInfoList &Inputs, |
| 567 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 568 | const char *LinkingOutput) const; |
| 569 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 570 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 571 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 572 | Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 573 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 574 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 575 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 576 | |
| 577 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 578 | const InputInfo &Output, |
| 579 | const InputInfoList &Inputs, |
| 580 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 581 | const char *LinkingOutput) const; |
| 582 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 583 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 584 | |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 585 | /// Visual studio tools. |
| 586 | namespace visualstudio { |
| 587 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 588 | public: |
| 589 | Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} |
| 590 | |
| 591 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 592 | virtual bool isLinkJob() const { return true; } |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 593 | |
| 594 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 595 | const InputInfo &Output, |
| 596 | const InputInfoList &Inputs, |
| 597 | const ArgList &TCArgs, |
| 598 | const char *LinkingOutput) const; |
| 599 | }; |
| 600 | } // end namespace visualstudio |
| 601 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 602 | } // end namespace toolchains |
| 603 | } // end namespace driver |
| 604 | } // end namespace clang |
| 605 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 606 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |