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" |
Douglas Katzman | 3459ce2 | 2015-10-08 04:24:12 +0000 | [diff] [blame] | 17 | #include "clang/Frontend/CodeGenOptions.h" |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/Triple.h" |
Reid Kleckner | 898229a | 2013-06-14 17:17:23 +0000 | [diff] [blame] | 19 | #include "llvm/Option/Option.h" |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 20 | #include "llvm/Support/Compiler.h" |
| 21 | |
| 22 | namespace clang { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 23 | class ObjCRuntime; |
John McCall | 5fb5df9 | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 24 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 25 | namespace driver { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 26 | class Command; |
| 27 | class Driver; |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 28 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 29 | namespace toolchains { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 30 | class MachO; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 33 | namespace tools { |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 34 | |
| 35 | namespace visualstudio { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 36 | class Compiler; |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 37 | } |
| 38 | |
Reid Kleckner | 898229a | 2013-06-14 17:17:23 +0000 | [diff] [blame] | 39 | using llvm::opt::ArgStringList; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 40 | |
Saleem Abdulrasool | d44901f | 2015-09-26 03:26:44 +0000 | [diff] [blame] | 41 | SmallString<128> getCompilerRT(const ToolChain &TC, |
| 42 | const llvm::opt::ArgList &Args, |
| 43 | StringRef Component, bool Shared = false); |
Peter Collingbourne | 581f438 | 2015-07-02 01:48:12 +0000 | [diff] [blame] | 44 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 45 | /// \brief Clang compiler tool. |
| 46 | class LLVM_LIBRARY_VISIBILITY Clang : public Tool { |
| 47 | public: |
| 48 | static const char *getBaseInputName(const llvm::opt::ArgList &Args, |
| 49 | const InputInfo &Input); |
| 50 | static const char *getBaseInputStem(const llvm::opt::ArgList &Args, |
| 51 | const InputInfoList &Inputs); |
| 52 | static const char *getDependencyFileName(const llvm::opt::ArgList &Args, |
| 53 | const InputInfoList &Inputs); |
Bob Wilson | decc03e | 2012-11-23 06:14:39 +0000 | [diff] [blame] | 54 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 55 | private: |
| 56 | void AddPreprocessingOptions(Compilation &C, const JobAction &JA, |
| 57 | const Driver &D, const llvm::opt::ArgList &Args, |
| 58 | llvm::opt::ArgStringList &CmdArgs, |
| 59 | const InputInfo &Output, |
| 60 | const InputInfoList &Inputs) const; |
Daniel Dunbar | d067f7f | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 61 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 62 | void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 63 | llvm::opt::ArgStringList &CmdArgs) const; |
Saleem Abdulrasool | ce63ce9 | 2015-09-19 18:19:44 +0000 | [diff] [blame] | 64 | void AddARMTargetArgs(const llvm::Triple &Triple, |
| 65 | const llvm::opt::ArgList &Args, |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 66 | llvm::opt::ArgStringList &CmdArgs, |
| 67 | bool KernelOrKext) const; |
| 68 | void AddARM64TargetArgs(const llvm::opt::ArgList &Args, |
Ulrich Weigand | 8afad61 | 2014-07-28 13:17:52 +0000 | [diff] [blame] | 69 | llvm::opt::ArgStringList &CmdArgs) const; |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 70 | void AddMIPSTargetArgs(const llvm::opt::ArgList &Args, |
| 71 | llvm::opt::ArgStringList &CmdArgs) const; |
| 72 | void AddPPCTargetArgs(const llvm::opt::ArgList &Args, |
Hans Wennborg | 75958c4 | 2013-08-08 00:17:41 +0000 | [diff] [blame] | 73 | llvm::opt::ArgStringList &CmdArgs) const; |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 74 | void AddR600TargetArgs(const llvm::opt::ArgList &Args, |
| 75 | llvm::opt::ArgStringList &CmdArgs) const; |
| 76 | void AddSparcTargetArgs(const llvm::opt::ArgList &Args, |
| 77 | llvm::opt::ArgStringList &CmdArgs) const; |
| 78 | void AddSystemZTargetArgs(const llvm::opt::ArgList &Args, |
| 79 | llvm::opt::ArgStringList &CmdArgs) const; |
| 80 | void AddX86TargetArgs(const llvm::opt::ArgList &Args, |
| 81 | llvm::opt::ArgStringList &CmdArgs) const; |
| 82 | void AddHexagonTargetArgs(const llvm::opt::ArgList &Args, |
| 83 | llvm::opt::ArgStringList &CmdArgs) const; |
Hans Wennborg | 75958c4 | 2013-08-08 00:17:41 +0000 | [diff] [blame] | 84 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 85 | enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile }; |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 86 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 87 | ObjCRuntime AddObjCRuntimeArgs(const llvm::opt::ArgList &args, |
| 88 | llvm::opt::ArgStringList &cmdArgs, |
| 89 | RewriteKind rewrite) const; |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 90 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 91 | void AddClangCLArgs(const llvm::opt::ArgList &Args, |
Douglas Katzman | 3459ce2 | 2015-10-08 04:24:12 +0000 | [diff] [blame] | 92 | llvm::opt::ArgStringList &CmdArgs, |
| 93 | enum CodeGenOptions::DebugInfoKind *DebugInfoKind, |
| 94 | bool *EmitCodeView) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 95 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 96 | visualstudio::Compiler *getCLFallback() const; |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 97 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 98 | mutable std::unique_ptr<visualstudio::Compiler> CLFallback; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 99 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 100 | public: |
| 101 | // CAUTION! The first constructor argument ("clang") is not arbitrary, |
| 102 | // as it is for other tools. Some operations on a Tool actually test |
| 103 | // whether that tool is Clang based on the Tool's Name as a string. |
| 104 | Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC, RF_Full) {} |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 105 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 106 | bool hasGoodDiagnostics() const override { return true; } |
| 107 | bool hasIntegratedAssembler() const override { return true; } |
| 108 | bool hasIntegratedCPP() const override { return true; } |
| 109 | bool canEmitIR() const override { return true; } |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 110 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 111 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 112 | const InputInfo &Output, const InputInfoList &Inputs, |
| 113 | const llvm::opt::ArgList &TCArgs, |
| 114 | const char *LinkingOutput) const override; |
| 115 | }; |
Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 116 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 117 | /// \brief Clang integrated assembler tool. |
| 118 | class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { |
| 119 | public: |
| 120 | ClangAs(const ToolChain &TC) |
| 121 | : Tool("clang::as", "clang integrated assembler", TC, RF_Full) {} |
| 122 | void AddMIPSTargetArgs(const llvm::opt::ArgList &Args, |
| 123 | llvm::opt::ArgStringList &CmdArgs) const; |
| 124 | bool hasGoodDiagnostics() const override { return true; } |
| 125 | bool hasIntegratedAssembler() const override { return false; } |
| 126 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 127 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 128 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 129 | const InputInfo &Output, const InputInfoList &Inputs, |
| 130 | const llvm::opt::ArgList &TCArgs, |
| 131 | const char *LinkingOutput) const override; |
| 132 | }; |
| 133 | |
| 134 | /// \brief Base class for all GNU tools that provide the same behavior when |
| 135 | /// it comes to response files support |
| 136 | class LLVM_LIBRARY_VISIBILITY GnuTool : public Tool { |
| 137 | virtual void anchor(); |
| 138 | |
| 139 | public: |
| 140 | GnuTool(const char *Name, const char *ShortName, const ToolChain &TC) |
| 141 | : Tool(Name, ShortName, TC, RF_Full, llvm::sys::WEM_CurrentCodePage) {} |
| 142 | }; |
| 143 | |
| 144 | /// gcc - Generic GCC tool implementations. |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 145 | namespace gcc { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 146 | class LLVM_LIBRARY_VISIBILITY Common : public GnuTool { |
| 147 | public: |
| 148 | Common(const char *Name, const char *ShortName, const ToolChain &TC) |
| 149 | : GnuTool(Name, ShortName, TC) {} |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 150 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 151 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 152 | const InputInfo &Output, const InputInfoList &Inputs, |
| 153 | const llvm::opt::ArgList &TCArgs, |
| 154 | const char *LinkingOutput) const override; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 155 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 156 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 157 | /// the particular tool mode. |
| 158 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 159 | llvm::opt::ArgStringList &CmdArgs) const = 0; |
| 160 | }; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 161 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 162 | class LLVM_LIBRARY_VISIBILITY Preprocessor : public Common { |
| 163 | public: |
| 164 | Preprocessor(const ToolChain &TC) |
| 165 | : Common("gcc::Preprocessor", "gcc preprocessor", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 166 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 167 | bool hasGoodDiagnostics() const override { return true; } |
| 168 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 169 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 170 | void RenderExtraToolArgs(const JobAction &JA, |
| 171 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 172 | }; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 173 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 174 | class LLVM_LIBRARY_VISIBILITY Compiler : public Common { |
| 175 | public: |
| 176 | Compiler(const ToolChain &TC) : Common("gcc::Compiler", "gcc frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 177 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 178 | bool hasGoodDiagnostics() const override { return true; } |
| 179 | bool hasIntegratedCPP() const override { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 180 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 181 | void RenderExtraToolArgs(const JobAction &JA, |
| 182 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 183 | }; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 184 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 185 | class LLVM_LIBRARY_VISIBILITY Linker : public Common { |
| 186 | public: |
| 187 | Linker(const ToolChain &TC) : Common("gcc::Linker", "linker (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 188 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 189 | bool hasIntegratedCPP() const override { return false; } |
| 190 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 191 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 192 | void RenderExtraToolArgs(const JobAction &JA, |
| 193 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 194 | }; |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 195 | } // end namespace gcc |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 196 | |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 197 | namespace hexagon { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 198 | // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile |
| 199 | // and Compile. |
| 200 | // We simply use "clang -cc1" for those actions. |
| 201 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 202 | public: |
| 203 | Assembler(const ToolChain &TC) |
| 204 | : GnuTool("hexagon::Assembler", "hexagon-as", TC) {} |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 205 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 206 | bool hasIntegratedCPP() const override { return false; } |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 207 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 208 | void RenderExtraToolArgs(const JobAction &JA, |
| 209 | llvm::opt::ArgStringList &CmdArgs) const; |
| 210 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 211 | const InputInfo &Output, const InputInfoList &Inputs, |
| 212 | const llvm::opt::ArgList &TCArgs, |
| 213 | const char *LinkingOutput) const override; |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 214 | }; |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 215 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 216 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 217 | public: |
| 218 | Linker(const ToolChain &TC) : GnuTool("hexagon::Linker", "hexagon-ld", TC) {} |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 219 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 220 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 221 | bool isLinkJob() const override { return true; } |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 222 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 223 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 224 | llvm::opt::ArgStringList &CmdArgs) const; |
| 225 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 226 | const InputInfo &Output, const InputInfoList &Inputs, |
| 227 | const llvm::opt::ArgList &TCArgs, |
| 228 | const char *LinkingOutput) const override; |
| 229 | }; |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 230 | } // end namespace hexagon. |
| 231 | |
Tom Stellard | 8fa3309 | 2015-07-18 01:49:05 +0000 | [diff] [blame] | 232 | namespace amdgpu { |
| 233 | |
| 234 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 235 | public: |
| 236 | Linker(const ToolChain &TC) : GnuTool("amdgpu::Linker", "lld", TC) {} |
| 237 | bool isLinkJob() const override { return true; } |
| 238 | bool hasIntegratedCPP() const override { return false; } |
| 239 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 240 | const InputInfo &Output, const InputInfoList &Inputs, |
| 241 | const llvm::opt::ArgList &TCArgs, |
| 242 | const char *LinkingOutput) const override; |
| 243 | }; |
| 244 | |
| 245 | } // end namespace amdgpu |
| 246 | |
Bernard Ogden | 3156176 | 2013-12-12 13:27:11 +0000 | [diff] [blame] | 247 | namespace arm { |
Renato Golin | e17c580 | 2015-07-27 23:44:42 +0000 | [diff] [blame] | 248 | std::string getARMTargetCPU(StringRef CPU, StringRef Arch, |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 249 | const llvm::Triple &Triple); |
Renato Golin | e17c580 | 2015-07-27 23:44:42 +0000 | [diff] [blame] | 250 | const std::string getARMArch(StringRef Arch, |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 251 | const llvm::Triple &Triple); |
Chandler Carruth | d96f37a | 2015-08-30 07:51:18 +0000 | [diff] [blame] | 252 | StringRef getARMCPUForMArch(StringRef Arch, const llvm::Triple &Triple); |
Vladimir Sukharev | 64f6824 | 2015-09-23 09:29:32 +0000 | [diff] [blame] | 253 | StringRef getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch, |
| 254 | const llvm::Triple &Triple); |
Joerg Sonnenberger | 1689d3f | 2015-01-28 23:30:39 +0000 | [diff] [blame] | 255 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 256 | void appendEBLinkFlags(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs, |
| 257 | const llvm::Triple &Triple); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 258 | } // end namespace arm |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 259 | |
Jonathan Roelofs | 2cea1be | 2014-02-12 03:21:20 +0000 | [diff] [blame] | 260 | namespace mips { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 261 | typedef enum { NanLegacy = 1, Nan2008 = 2 } NanEncoding; |
Saleem Abdulrasool | d5556e3 | 2015-09-19 04:33:38 +0000 | [diff] [blame] | 262 | |
| 263 | enum class FloatABI { |
| 264 | Invalid, |
| 265 | Soft, |
| 266 | Hard, |
| 267 | }; |
| 268 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 269 | NanEncoding getSupportedNanEncoding(StringRef &CPU); |
| 270 | void getMipsCPUAndABI(const llvm::opt::ArgList &Args, |
| 271 | const llvm::Triple &Triple, StringRef &CPUName, |
| 272 | StringRef &ABIName); |
| 273 | bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value); |
| 274 | bool isUCLibc(const llvm::opt::ArgList &Args); |
| 275 | bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple); |
| 276 | bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName, |
Saleem Abdulrasool | d5556e3 | 2015-09-19 04:33:38 +0000 | [diff] [blame] | 277 | StringRef ABIName, mips::FloatABI FloatABI); |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 278 | bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, |
Saleem Abdulrasool | d5556e3 | 2015-09-19 04:33:38 +0000 | [diff] [blame] | 279 | StringRef CPUName, StringRef ABIName, |
| 280 | mips::FloatABI FloatABI); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 281 | } // end namespace mips |
Jonathan Roelofs | 2cea1be | 2014-02-12 03:21:20 +0000 | [diff] [blame] | 282 | |
Ulrich Weigand | 8afad61 | 2014-07-28 13:17:52 +0000 | [diff] [blame] | 283 | namespace ppc { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 284 | bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 285 | } // end namespace ppc |
Ulrich Weigand | 8afad61 | 2014-07-28 13:17:52 +0000 | [diff] [blame] | 286 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 287 | /// cloudabi -- Directly call GNU Binutils linker |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 288 | namespace cloudabi { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 289 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 290 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 291 | Linker(const ToolChain &TC) : GnuTool("cloudabi::Linker", "linker", TC) {} |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 292 | |
| 293 | bool hasIntegratedCPP() const override { return false; } |
| 294 | bool isLinkJob() const override { return true; } |
| 295 | |
| 296 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 297 | const InputInfo &Output, const InputInfoList &Inputs, |
| 298 | const llvm::opt::ArgList &TCArgs, |
| 299 | const char *LinkingOutput) const override; |
| 300 | }; |
| 301 | } // end namespace cloudabi |
| 302 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 303 | namespace darwin { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 304 | llvm::Triple::ArchType getArchTypeForMachOArchName(StringRef Str); |
| 305 | void setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str); |
Rafael Espindola | dcbf698 | 2012-10-31 18:51:07 +0000 | [diff] [blame] | 306 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 307 | class LLVM_LIBRARY_VISIBILITY MachOTool : public Tool { |
| 308 | virtual void anchor(); |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 309 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 310 | protected: |
| 311 | void AddMachOArch(const llvm::opt::ArgList &Args, |
| 312 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 313 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 314 | const toolchains::MachO &getMachOToolChain() const { |
| 315 | return reinterpret_cast<const toolchains::MachO &>(getToolChain()); |
| 316 | } |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 317 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 318 | public: |
| 319 | MachOTool( |
| 320 | const char *Name, const char *ShortName, const ToolChain &TC, |
| 321 | ResponseFileSupport ResponseSupport = RF_None, |
| 322 | llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, |
| 323 | const char *ResponseFlag = "@") |
| 324 | : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, |
| 325 | ResponseFlag) {} |
| 326 | }; |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 327 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 328 | class LLVM_LIBRARY_VISIBILITY Assembler : public MachOTool { |
| 329 | public: |
| 330 | Assembler(const ToolChain &TC) |
| 331 | : MachOTool("darwin::Assembler", "assembler", TC) {} |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 332 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 333 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 334 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 335 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 336 | const InputInfo &Output, const InputInfoList &Inputs, |
| 337 | const llvm::opt::ArgList &TCArgs, |
| 338 | const char *LinkingOutput) const override; |
| 339 | }; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 340 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 341 | class LLVM_LIBRARY_VISIBILITY Linker : public MachOTool { |
| 342 | bool NeedsTempPath(const InputInfoList &Inputs) const; |
| 343 | void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, |
| 344 | llvm::opt::ArgStringList &CmdArgs, |
| 345 | const InputInfoList &Inputs) const; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 346 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 347 | public: |
| 348 | Linker(const ToolChain &TC) |
| 349 | : MachOTool("darwin::Linker", "linker", TC, RF_FileList, |
| 350 | llvm::sys::WEM_UTF8, "-filelist") {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 351 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 352 | bool hasIntegratedCPP() const override { return false; } |
| 353 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 354 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 355 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 356 | const InputInfo &Output, const InputInfoList &Inputs, |
| 357 | const llvm::opt::ArgList &TCArgs, |
| 358 | const char *LinkingOutput) const override; |
| 359 | }; |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 360 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 361 | class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool { |
| 362 | public: |
| 363 | Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 364 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 365 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 366 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 367 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 368 | const InputInfo &Output, const InputInfoList &Inputs, |
| 369 | const llvm::opt::ArgList &TCArgs, |
| 370 | const char *LinkingOutput) const override; |
| 371 | }; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 372 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 373 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool { |
| 374 | public: |
| 375 | Dsymutil(const ToolChain &TC) |
| 376 | : MachOTool("darwin::Dsymutil", "dsymutil", TC) {} |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 377 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 378 | bool hasIntegratedCPP() const override { return false; } |
| 379 | bool isDsymutilJob() const override { return true; } |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 380 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 381 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 382 | const InputInfo &Output, const InputInfoList &Inputs, |
| 383 | const llvm::opt::ArgList &TCArgs, |
| 384 | const char *LinkingOutput) const override; |
| 385 | }; |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 386 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 387 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool { |
| 388 | public: |
| 389 | VerifyDebug(const ToolChain &TC) |
| 390 | : MachOTool("darwin::VerifyDebug", "dwarfdump", TC) {} |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 391 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 392 | bool hasIntegratedCPP() const override { return false; } |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 393 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 394 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 395 | const InputInfo &Output, const InputInfoList &Inputs, |
| 396 | const llvm::opt::ArgList &TCArgs, |
| 397 | const char *LinkingOutput) const override; |
| 398 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 399 | } // end namespace darwin |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 400 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 401 | /// openbsd -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 402 | namespace openbsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 403 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 404 | public: |
| 405 | Assembler(const ToolChain &TC) |
| 406 | : GnuTool("openbsd::Assembler", "assembler", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 407 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 408 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 409 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 410 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 411 | const InputInfo &Output, const InputInfoList &Inputs, |
| 412 | const llvm::opt::ArgList &TCArgs, |
| 413 | const char *LinkingOutput) const override; |
| 414 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 415 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 416 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 417 | public: |
| 418 | Linker(const ToolChain &TC) : GnuTool("openbsd::Linker", "linker", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 419 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 420 | bool hasIntegratedCPP() const override { return false; } |
| 421 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 422 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 423 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 424 | const InputInfo &Output, const InputInfoList &Inputs, |
| 425 | const llvm::opt::ArgList &TCArgs, |
| 426 | const char *LinkingOutput) const override; |
| 427 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 428 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 429 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 430 | /// bitrig -- Directly call GNU Binutils assembler and linker |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 431 | namespace bitrig { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 432 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 433 | public: |
| 434 | Assembler(const ToolChain &TC) |
| 435 | : GnuTool("bitrig::Assembler", "assembler", TC) {} |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 436 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 437 | bool hasIntegratedCPP() const override { return false; } |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 438 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 439 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 440 | const InputInfo &Output, const InputInfoList &Inputs, |
| 441 | const llvm::opt::ArgList &TCArgs, |
| 442 | const char *LinkingOutput) const override; |
| 443 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 444 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 445 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 446 | public: |
| 447 | Linker(const ToolChain &TC) : GnuTool("bitrig::Linker", "linker", TC) {} |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 448 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 449 | bool hasIntegratedCPP() const override { return false; } |
| 450 | bool isLinkJob() const override { return true; } |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 451 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +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; |
| 456 | }; |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 457 | } // end namespace bitrig |
| 458 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 459 | /// freebsd -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 460 | namespace freebsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 461 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 462 | public: |
| 463 | Assembler(const ToolChain &TC) |
| 464 | : GnuTool("freebsd::Assembler", "assembler", TC) {} |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 465 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 466 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 467 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 468 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 469 | const InputInfo &Output, const InputInfoList &Inputs, |
| 470 | const llvm::opt::ArgList &TCArgs, |
| 471 | const char *LinkingOutput) const override; |
| 472 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 473 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 474 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 475 | public: |
| 476 | Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {} |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 477 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 478 | bool hasIntegratedCPP() const override { return false; } |
| 479 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 480 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 481 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 482 | const InputInfo &Output, const InputInfoList &Inputs, |
| 483 | const llvm::opt::ArgList &TCArgs, |
| 484 | const char *LinkingOutput) const override; |
| 485 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 486 | } // end namespace freebsd |
| 487 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 488 | /// netbsd -- Directly call GNU Binutils assembler and linker |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 489 | namespace netbsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 490 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 491 | public: |
| 492 | Assembler(const ToolChain &TC) |
| 493 | : GnuTool("netbsd::Assembler", "assembler", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 494 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 495 | bool hasIntegratedCPP() const override { return false; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 496 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 497 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 498 | const InputInfo &Output, const InputInfoList &Inputs, |
| 499 | const llvm::opt::ArgList &TCArgs, |
| 500 | const char *LinkingOutput) const override; |
| 501 | }; |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 502 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 503 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 504 | public: |
| 505 | Linker(const ToolChain &TC) : GnuTool("netbsd::Linker", "linker", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 506 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 507 | bool hasIntegratedCPP() const override { return false; } |
| 508 | bool isLinkJob() const override { return true; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 509 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 510 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 511 | const InputInfo &Output, const InputInfoList &Inputs, |
| 512 | const llvm::opt::ArgList &TCArgs, |
| 513 | const char *LinkingOutput) const override; |
| 514 | }; |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 515 | } // end namespace netbsd |
| 516 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 517 | /// Directly call GNU Binutils' assembler and linker. |
Thomas Schwinge | 4e55526 | 2013-03-28 19:04:25 +0000 | [diff] [blame] | 518 | namespace gnutools { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 519 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 520 | public: |
| 521 | Assembler(const ToolChain &TC) : GnuTool("GNU::Assembler", "assembler", TC) {} |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 522 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 523 | bool hasIntegratedCPP() const override { return false; } |
| 524 | |
| 525 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 526 | const InputInfo &Output, const InputInfoList &Inputs, |
| 527 | const llvm::opt::ArgList &TCArgs, |
| 528 | const char *LinkingOutput) const override; |
| 529 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 530 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 531 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 532 | public: |
| 533 | Linker(const ToolChain &TC) : GnuTool("GNU::Linker", "linker", TC) {} |
| 534 | |
| 535 | bool hasIntegratedCPP() const override { return false; } |
| 536 | bool isLinkJob() const override { return true; } |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 537 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 538 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 539 | const InputInfo &Output, const InputInfoList &Inputs, |
| 540 | const llvm::opt::ArgList &TCArgs, |
| 541 | const char *LinkingOutput) const override; |
| 542 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 543 | } // end namespace gnutools |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 544 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 545 | namespace nacltools { |
| 546 | class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler { |
| 547 | public: |
| 548 | AssemblerARM(const ToolChain &TC) : gnutools::Assembler(TC) {} |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 549 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 550 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 551 | const InputInfo &Output, const InputInfoList &Inputs, |
| 552 | const llvm::opt::ArgList &TCArgs, |
| 553 | const char *LinkingOutput) const override; |
| 554 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 555 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 556 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 557 | public: |
| 558 | Linker(const ToolChain &TC) : Tool("NaCl::Linker", "linker", TC) {} |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 559 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 560 | bool hasIntegratedCPP() const override { return false; } |
| 561 | bool isLinkJob() const override { return true; } |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 562 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 563 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 564 | const InputInfo &Output, const InputInfoList &Inputs, |
| 565 | const llvm::opt::ArgList &TCArgs, |
| 566 | const char *LinkingOutput) const override; |
| 567 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 568 | } // end namespace nacltools |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 569 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 570 | /// minix -- Directly call GNU Binutils assembler and linker |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 571 | namespace minix { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 572 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 573 | public: |
| 574 | Assembler(const ToolChain &TC) |
| 575 | : GnuTool("minix::Assembler", "assembler", TC) {} |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 576 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 577 | bool hasIntegratedCPP() const override { return false; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 578 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 579 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 580 | const InputInfo &Output, const InputInfoList &Inputs, |
| 581 | const llvm::opt::ArgList &TCArgs, |
| 582 | const char *LinkingOutput) const override; |
| 583 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 584 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 585 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 586 | public: |
| 587 | Linker(const ToolChain &TC) : GnuTool("minix::Linker", "linker", TC) {} |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 588 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 589 | bool hasIntegratedCPP() const override { return false; } |
| 590 | bool isLinkJob() const override { return true; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 591 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 592 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 593 | const InputInfo &Output, const InputInfoList &Inputs, |
| 594 | const llvm::opt::ArgList &TCArgs, |
| 595 | const char *LinkingOutput) const override; |
| 596 | }; |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 597 | } // end namespace minix |
| 598 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 599 | /// solaris -- Directly call Solaris assembler and linker |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 600 | namespace solaris { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 601 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 602 | public: |
| 603 | Assembler(const ToolChain &TC) |
| 604 | : Tool("solaris::Assembler", "assembler", TC) {} |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 605 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 606 | bool hasIntegratedCPP() const override { return false; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 607 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 608 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 609 | const InputInfo &Output, const InputInfoList &Inputs, |
| 610 | const llvm::opt::ArgList &TCArgs, |
| 611 | const char *LinkingOutput) const override; |
| 612 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 613 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 614 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 615 | public: |
| 616 | Linker(const ToolChain &TC) : Tool("solaris::Linker", "linker", TC) {} |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 617 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 618 | bool hasIntegratedCPP() const override { return false; } |
| 619 | bool isLinkJob() const override { return true; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 620 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 621 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 622 | const InputInfo &Output, const InputInfoList &Inputs, |
| 623 | const llvm::opt::ArgList &TCArgs, |
| 624 | const char *LinkingOutput) const override; |
| 625 | }; |
David Chisnall | a9ed5d7 | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 626 | } // end namespace solaris |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 627 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 628 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 629 | namespace dragonfly { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 630 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 631 | public: |
| 632 | Assembler(const ToolChain &TC) |
| 633 | : GnuTool("dragonfly::Assembler", "assembler", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 634 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 635 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 636 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 637 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 638 | const InputInfo &Output, const InputInfoList &Inputs, |
| 639 | const llvm::opt::ArgList &TCArgs, |
| 640 | const char *LinkingOutput) const override; |
| 641 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 642 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 643 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 644 | public: |
| 645 | Linker(const ToolChain &TC) : GnuTool("dragonfly::Linker", "linker", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 646 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 647 | bool hasIntegratedCPP() const override { return false; } |
| 648 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 649 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 650 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 651 | const InputInfo &Output, const InputInfoList &Inputs, |
| 652 | const llvm::opt::ArgList &TCArgs, |
| 653 | const char *LinkingOutput) const override; |
| 654 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 655 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 656 | |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 657 | /// Visual studio tools. |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 658 | namespace visualstudio { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 659 | VersionTuple getMSVCVersion(const Driver *D, const llvm::Triple &Triple, |
| 660 | const llvm::opt::ArgList &Args, bool IsWindowsMSVC); |
David Majnemer | e11d373 | 2015-06-08 00:22:46 +0000 | [diff] [blame] | 661 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 662 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 663 | public: |
| 664 | Linker(const ToolChain &TC) |
| 665 | : Tool("visualstudio::Linker", "linker", TC, RF_Full, |
| 666 | llvm::sys::WEM_UTF16) {} |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 667 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 668 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 669 | bool isLinkJob() const override { return true; } |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 670 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 671 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 672 | const InputInfo &Output, const InputInfoList &Inputs, |
| 673 | const llvm::opt::ArgList &TCArgs, |
| 674 | const char *LinkingOutput) const override; |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 675 | }; |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 676 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 677 | class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { |
| 678 | public: |
| 679 | Compiler(const ToolChain &TC) |
| 680 | : Tool("visualstudio::Compiler", "compiler", TC, RF_Full, |
| 681 | llvm::sys::WEM_UTF16) {} |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 682 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 683 | bool hasIntegratedAssembler() const override { return true; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 684 | bool hasIntegratedCPP() const override { return true; } |
| 685 | bool isLinkJob() const override { return false; } |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 686 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 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; |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 691 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 692 | std::unique_ptr<Command> GetCommand(Compilation &C, const JobAction &JA, |
| 693 | const InputInfo &Output, |
| 694 | const InputInfoList &Inputs, |
| 695 | const llvm::opt::ArgList &TCArgs, |
| 696 | const char *LinkingOutput) const; |
| 697 | }; |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 698 | } // end namespace visualstudio |
| 699 | |
Yaron Keren | 1c0070c | 2015-07-02 04:45:27 +0000 | [diff] [blame] | 700 | /// MinGW -- Directly call GNU Binutils assembler and linker |
| 701 | namespace MinGW { |
| 702 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 703 | public: |
| 704 | Assembler(const ToolChain &TC) : Tool("MinGW::Assemble", "assembler", TC) {} |
| 705 | |
| 706 | bool hasIntegratedCPP() const override { return false; } |
| 707 | |
| 708 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 709 | const InputInfo &Output, const InputInfoList &Inputs, |
| 710 | const llvm::opt::ArgList &TCArgs, |
| 711 | const char *LinkingOutput) const override; |
| 712 | }; |
| 713 | |
| 714 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 715 | public: |
| 716 | Linker(const ToolChain &TC) : Tool("MinGW::Linker", "linker", TC) {} |
| 717 | |
| 718 | bool hasIntegratedCPP() const override { return false; } |
| 719 | bool isLinkJob() const override { return true; } |
| 720 | |
| 721 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 722 | const InputInfo &Output, const InputInfoList &Inputs, |
| 723 | const llvm::opt::ArgList &TCArgs, |
| 724 | const char *LinkingOutput) const override; |
| 725 | |
| 726 | private: |
| 727 | void AddLibGCC(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const; |
| 728 | }; |
| 729 | } // end namespace MinGW |
| 730 | |
Tim Northover | 9c7e035 | 2013-12-12 11:55:52 +0000 | [diff] [blame] | 731 | namespace arm { |
Saleem Abdulrasool | eee54b4 | 2015-09-18 05:32:23 +0000 | [diff] [blame] | 732 | enum class FloatABI { |
| 733 | Invalid, |
| 734 | Soft, |
| 735 | SoftFP, |
| 736 | Hard, |
| 737 | }; |
| 738 | |
Saleem Abdulrasool | 06f6f99 | 2015-09-19 20:40:16 +0000 | [diff] [blame] | 739 | FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 740 | } // end namespace arm |
| 741 | |
Robert Lytton | cf1dd69 | 2013-10-11 10:29:40 +0000 | [diff] [blame] | 742 | namespace XCore { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 743 | // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and |
| 744 | // Compile. |
| 745 | // We simply use "clang -cc1" for those actions. |
| 746 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 747 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 748 | Assembler(const ToolChain &TC) : Tool("XCore::Assembler", "XCore-as", TC) {} |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 749 | |
| 750 | bool hasIntegratedCPP() const override { return false; } |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 751 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 752 | const InputInfo &Output, const InputInfoList &Inputs, |
| 753 | const llvm::opt::ArgList &TCArgs, |
| 754 | const char *LinkingOutput) const override; |
| 755 | }; |
| 756 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 757 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 758 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 759 | Linker(const ToolChain &TC) : Tool("XCore::Linker", "XCore-ld", TC) {} |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 760 | |
| 761 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 762 | bool isLinkJob() const override { return true; } |
| 763 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 764 | const InputInfo &Output, const InputInfoList &Inputs, |
| 765 | const llvm::opt::ArgList &TCArgs, |
| 766 | const char *LinkingOutput) const override; |
| 767 | }; |
| 768 | } // end namespace XCore. |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 769 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 770 | namespace CrossWindows { |
| 771 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 772 | public: |
| 773 | Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {} |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 774 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 775 | bool hasIntegratedCPP() const override { return false; } |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 776 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 777 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 778 | const InputInfo &Output, const InputInfoList &Inputs, |
| 779 | const llvm::opt::ArgList &TCArgs, |
| 780 | const char *LinkingOutput) const override; |
| 781 | }; |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 782 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 783 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 784 | public: |
| 785 | Linker(const ToolChain &TC) |
| 786 | : Tool("CrossWindows::Linker", "ld", TC, RF_Full) {} |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 787 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 788 | bool hasIntegratedCPP() const override { return false; } |
| 789 | bool isLinkJob() const override { return true; } |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 790 | |
| 791 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 792 | const InputInfo &Output, const InputInfoList &Inputs, |
| 793 | const llvm::opt::ArgList &TCArgs, |
| 794 | const char *LinkingOutput) const override; |
| 795 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 796 | } // end namespace CrossWindows |
Robert Lytton | cf1dd69 | 2013-10-11 10:29:40 +0000 | [diff] [blame] | 797 | |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 798 | /// SHAVE tools -- Directly call moviCompile and moviAsm |
| 799 | namespace SHAVE { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 800 | class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 801 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 802 | Compiler(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {} |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 803 | |
| 804 | bool hasIntegratedCPP() const override { return true; } |
| 805 | |
| 806 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 807 | const InputInfo &Output, const InputInfoList &Inputs, |
| 808 | const llvm::opt::ArgList &TCArgs, |
| 809 | const char *LinkingOutput) const override; |
| 810 | }; |
| 811 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 812 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 813 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 814 | Assembler(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {} |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 815 | |
| 816 | bool hasIntegratedCPP() const override { return false; } // not sure. |
| 817 | |
| 818 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 819 | const InputInfo &Output, const InputInfoList &Inputs, |
| 820 | const llvm::opt::ArgList &TCArgs, |
| 821 | const char *LinkingOutput) const override; |
| 822 | }; |
| 823 | } // end namespace SHAVE |
| 824 | |
Douglas Katzman | d6e597c | 2015-09-17 19:56:40 +0000 | [diff] [blame] | 825 | /// The Myriad toolchain uses tools that are in two different namespaces. |
| 826 | /// The Compiler and Assembler as defined above are in the SHAVE namespace, |
| 827 | /// whereas the linker, which accepts code for a mixture of Sparc and SHAVE, |
| 828 | /// is in the Myriad namespace. |
| 829 | namespace Myriad { |
| 830 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 831 | public: |
| 832 | Linker(const ToolChain &TC) : GnuTool("shave::Linker", "ld", TC) {} |
| 833 | bool hasIntegratedCPP() const override { return false; } |
| 834 | bool isLinkJob() const override { return true; } |
| 835 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 836 | const InputInfo &Output, const InputInfoList &Inputs, |
| 837 | const llvm::opt::ArgList &TCArgs, |
| 838 | const char *LinkingOutput) const override; |
| 839 | }; |
| 840 | } // end namespace Myriad |
| 841 | |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 842 | namespace PS4cpu { |
| 843 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 844 | public: |
| 845 | Assemble(const ToolChain &TC) |
| 846 | : Tool("PS4cpu::Assemble", "assembler", TC, RF_Full) {} |
| 847 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 848 | bool hasIntegratedCPP() const override { return false; } |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 849 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 850 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 851 | const InputInfo &Output, |
| 852 | const InputInfoList &Inputs, |
| 853 | const llvm::opt::ArgList &TCArgs, |
| 854 | const char *LinkingOutput) const override; |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 855 | }; |
| 856 | |
| 857 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 858 | public: |
| 859 | Link(const ToolChain &TC) : Tool("PS4cpu::Link", "linker", TC, RF_Full) {} |
| 860 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 861 | bool hasIntegratedCPP() const override { return false; } |
| 862 | bool isLinkJob() const override { return true; } |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 863 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 864 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 865 | const InputInfo &Output, |
| 866 | const InputInfoList &Inputs, |
| 867 | const llvm::opt::ArgList &TCArgs, |
| 868 | const char *LinkingOutput) const override; |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 869 | }; |
| 870 | } // end namespace PS4cpu |
| 871 | |
Douglas Katzman | 9dc5fbb | 2015-06-03 16:56:50 +0000 | [diff] [blame] | 872 | } // end namespace tools |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 873 | } // end namespace driver |
| 874 | } // end namespace clang |
| 875 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 876 | #endif // LLVM_CLANG_LIB_DRIVER_TOOLS_H |