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