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