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