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); |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame^] | 273 | std::string getMipsABILibSuffix(const llvm::opt::ArgList &Args, |
| 274 | const llvm::Triple &Triple); |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 275 | bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value); |
| 276 | bool isUCLibc(const llvm::opt::ArgList &Args); |
| 277 | bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple); |
| 278 | bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName, |
Saleem Abdulrasool | d5556e3 | 2015-09-19 04:33:38 +0000 | [diff] [blame] | 279 | StringRef ABIName, mips::FloatABI FloatABI); |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 280 | bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, |
Saleem Abdulrasool | d5556e3 | 2015-09-19 04:33:38 +0000 | [diff] [blame] | 281 | StringRef CPUName, StringRef ABIName, |
| 282 | mips::FloatABI FloatABI); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 283 | } // end namespace mips |
Jonathan Roelofs | 2cea1be | 2014-02-12 03:21:20 +0000 | [diff] [blame] | 284 | |
Ulrich Weigand | 8afad61 | 2014-07-28 13:17:52 +0000 | [diff] [blame] | 285 | namespace ppc { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 286 | bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 287 | } // end namespace ppc |
Ulrich Weigand | 8afad61 | 2014-07-28 13:17:52 +0000 | [diff] [blame] | 288 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 289 | /// cloudabi -- Directly call GNU Binutils linker |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 290 | namespace cloudabi { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 291 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 292 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 293 | Linker(const ToolChain &TC) : GnuTool("cloudabi::Linker", "linker", TC) {} |
Ed Schouten | 3c3e58c | 2015-03-26 11:13:44 +0000 | [diff] [blame] | 294 | |
| 295 | bool hasIntegratedCPP() const override { return false; } |
| 296 | bool isLinkJob() const override { return true; } |
| 297 | |
| 298 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 299 | const InputInfo &Output, const InputInfoList &Inputs, |
| 300 | const llvm::opt::ArgList &TCArgs, |
| 301 | const char *LinkingOutput) const override; |
| 302 | }; |
| 303 | } // end namespace cloudabi |
| 304 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 305 | namespace darwin { |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 306 | llvm::Triple::ArchType getArchTypeForMachOArchName(StringRef Str); |
| 307 | void setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str); |
Rafael Espindola | dcbf698 | 2012-10-31 18:51:07 +0000 | [diff] [blame] | 308 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 309 | class LLVM_LIBRARY_VISIBILITY MachOTool : public Tool { |
| 310 | virtual void anchor(); |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 311 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 312 | protected: |
| 313 | void AddMachOArch(const llvm::opt::ArgList &Args, |
| 314 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 315 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 316 | const toolchains::MachO &getMachOToolChain() const { |
| 317 | return reinterpret_cast<const toolchains::MachO &>(getToolChain()); |
| 318 | } |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 319 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 320 | public: |
| 321 | MachOTool( |
| 322 | const char *Name, const char *ShortName, const ToolChain &TC, |
| 323 | ResponseFileSupport ResponseSupport = RF_None, |
| 324 | llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, |
| 325 | const char *ResponseFlag = "@") |
| 326 | : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, |
| 327 | ResponseFlag) {} |
| 328 | }; |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 329 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 330 | class LLVM_LIBRARY_VISIBILITY Assembler : public MachOTool { |
| 331 | public: |
| 332 | Assembler(const ToolChain &TC) |
| 333 | : MachOTool("darwin::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 336 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 337 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 338 | const InputInfo &Output, const InputInfoList &Inputs, |
| 339 | const llvm::opt::ArgList &TCArgs, |
| 340 | const char *LinkingOutput) const override; |
| 341 | }; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 342 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 343 | class LLVM_LIBRARY_VISIBILITY Linker : public MachOTool { |
| 344 | bool NeedsTempPath(const InputInfoList &Inputs) const; |
| 345 | void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, |
| 346 | llvm::opt::ArgStringList &CmdArgs, |
| 347 | const InputInfoList &Inputs) const; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 348 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 349 | public: |
| 350 | Linker(const ToolChain &TC) |
| 351 | : MachOTool("darwin::Linker", "linker", TC, RF_FileList, |
| 352 | llvm::sys::WEM_UTF8, "-filelist") {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 353 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 354 | bool hasIntegratedCPP() const override { return false; } |
| 355 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 356 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 357 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 358 | const InputInfo &Output, const InputInfoList &Inputs, |
| 359 | const llvm::opt::ArgList &TCArgs, |
| 360 | const char *LinkingOutput) const override; |
| 361 | }; |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 362 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 363 | class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool { |
| 364 | public: |
| 365 | Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 366 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 367 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 368 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 369 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 370 | const InputInfo &Output, const InputInfoList &Inputs, |
| 371 | const llvm::opt::ArgList &TCArgs, |
| 372 | const char *LinkingOutput) const override; |
| 373 | }; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 374 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 375 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool { |
| 376 | public: |
| 377 | Dsymutil(const ToolChain &TC) |
| 378 | : MachOTool("darwin::Dsymutil", "dsymutil", TC) {} |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 379 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 380 | bool hasIntegratedCPP() const override { return false; } |
| 381 | bool isDsymutilJob() const override { return true; } |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 382 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 383 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 384 | const InputInfo &Output, const InputInfoList &Inputs, |
| 385 | const llvm::opt::ArgList &TCArgs, |
| 386 | const char *LinkingOutput) const override; |
| 387 | }; |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 388 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 389 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool { |
| 390 | public: |
| 391 | VerifyDebug(const ToolChain &TC) |
| 392 | : MachOTool("darwin::VerifyDebug", "dwarfdump", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 395 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +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; |
| 400 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 401 | } // end namespace darwin |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 402 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 403 | /// openbsd -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 404 | namespace openbsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 405 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 406 | public: |
| 407 | Assembler(const ToolChain &TC) |
| 408 | : GnuTool("openbsd::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 411 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +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; |
| 416 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 417 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 418 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 419 | public: |
| 420 | Linker(const ToolChain &TC) : GnuTool("openbsd::Linker", "linker", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 421 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 422 | bool hasIntegratedCPP() const override { return false; } |
| 423 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 424 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 425 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 426 | const InputInfo &Output, const InputInfoList &Inputs, |
| 427 | const llvm::opt::ArgList &TCArgs, |
| 428 | const char *LinkingOutput) const override; |
| 429 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 430 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 431 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 432 | /// bitrig -- Directly call GNU Binutils assembler and linker |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 433 | namespace bitrig { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 434 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 435 | public: |
| 436 | Assembler(const ToolChain &TC) |
| 437 | : GnuTool("bitrig::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 440 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 441 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 442 | const InputInfo &Output, const InputInfoList &Inputs, |
| 443 | const llvm::opt::ArgList &TCArgs, |
| 444 | const char *LinkingOutput) const override; |
| 445 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 446 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 447 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 448 | public: |
| 449 | Linker(const ToolChain &TC) : GnuTool("bitrig::Linker", "linker", TC) {} |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 450 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 451 | bool hasIntegratedCPP() const override { return false; } |
| 452 | bool isLinkJob() const override { return true; } |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 453 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 454 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 455 | const InputInfo &Output, const InputInfoList &Inputs, |
| 456 | const llvm::opt::ArgList &TCArgs, |
| 457 | const char *LinkingOutput) const override; |
| 458 | }; |
Eli Friedman | 9fa2885 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 459 | } // end namespace bitrig |
| 460 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 461 | /// freebsd -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 462 | namespace freebsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 463 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 464 | public: |
| 465 | Assembler(const ToolChain &TC) |
| 466 | : GnuTool("freebsd::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 469 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 470 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 471 | const InputInfo &Output, const InputInfoList &Inputs, |
| 472 | const llvm::opt::ArgList &TCArgs, |
| 473 | const char *LinkingOutput) const override; |
| 474 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 475 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 476 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 477 | public: |
| 478 | Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {} |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 479 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 480 | bool hasIntegratedCPP() const override { return false; } |
| 481 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 482 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +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; |
| 487 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 488 | } // end namespace freebsd |
| 489 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 490 | /// netbsd -- Directly call GNU Binutils assembler and linker |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 491 | namespace netbsd { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 492 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 493 | public: |
| 494 | Assembler(const ToolChain &TC) |
| 495 | : GnuTool("netbsd::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 498 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 499 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 500 | const InputInfo &Output, const InputInfoList &Inputs, |
| 501 | const llvm::opt::ArgList &TCArgs, |
| 502 | const char *LinkingOutput) const override; |
| 503 | }; |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 504 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 505 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 506 | public: |
| 507 | Linker(const ToolChain &TC) : GnuTool("netbsd::Linker", "linker", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 508 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 509 | bool hasIntegratedCPP() const override { return false; } |
| 510 | bool isLinkJob() const override { return true; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 511 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 512 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 513 | const InputInfo &Output, const InputInfoList &Inputs, |
| 514 | const llvm::opt::ArgList &TCArgs, |
| 515 | const char *LinkingOutput) const override; |
| 516 | }; |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 517 | } // end namespace netbsd |
| 518 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 519 | /// Directly call GNU Binutils' assembler and linker. |
Thomas Schwinge | 4e55526 | 2013-03-28 19:04:25 +0000 | [diff] [blame] | 520 | namespace gnutools { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 521 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 522 | public: |
| 523 | Assembler(const ToolChain &TC) : GnuTool("GNU::Assembler", "assembler", TC) {} |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 524 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 525 | bool hasIntegratedCPP() const override { return false; } |
| 526 | |
| 527 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 528 | const InputInfo &Output, const InputInfoList &Inputs, |
| 529 | const llvm::opt::ArgList &TCArgs, |
| 530 | const char *LinkingOutput) const override; |
| 531 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 532 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 533 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 534 | public: |
| 535 | Linker(const ToolChain &TC) : GnuTool("GNU::Linker", "linker", TC) {} |
| 536 | |
| 537 | bool hasIntegratedCPP() const override { return false; } |
| 538 | bool isLinkJob() const override { return true; } |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 539 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 540 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 541 | const InputInfo &Output, const InputInfoList &Inputs, |
| 542 | const llvm::opt::ArgList &TCArgs, |
| 543 | const char *LinkingOutput) const override; |
| 544 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 545 | } // end namespace gnutools |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 546 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 547 | namespace nacltools { |
| 548 | class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler { |
| 549 | public: |
| 550 | AssemblerARM(const ToolChain &TC) : gnutools::Assembler(TC) {} |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 551 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 552 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 553 | const InputInfo &Output, const InputInfoList &Inputs, |
| 554 | const llvm::opt::ArgList &TCArgs, |
| 555 | const char *LinkingOutput) const override; |
| 556 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 557 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 558 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 559 | public: |
| 560 | Linker(const ToolChain &TC) : Tool("NaCl::Linker", "linker", TC) {} |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 561 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 562 | bool hasIntegratedCPP() const override { return false; } |
| 563 | bool isLinkJob() const override { return true; } |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 564 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 565 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 566 | const InputInfo &Output, const InputInfoList &Inputs, |
| 567 | const llvm::opt::ArgList &TCArgs, |
| 568 | const char *LinkingOutput) const override; |
| 569 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 570 | } // end namespace nacltools |
Derek Schuff | 6ab52fa | 2015-03-30 20:31:33 +0000 | [diff] [blame] | 571 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 572 | /// minix -- Directly call GNU Binutils assembler and linker |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 573 | namespace minix { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 574 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 575 | public: |
| 576 | Assembler(const ToolChain &TC) |
| 577 | : GnuTool("minix::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 580 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 581 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 582 | const InputInfo &Output, const InputInfoList &Inputs, |
| 583 | const llvm::opt::ArgList &TCArgs, |
| 584 | const char *LinkingOutput) const override; |
| 585 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 586 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 587 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 588 | public: |
| 589 | Linker(const ToolChain &TC) : GnuTool("minix::Linker", "linker", TC) {} |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 590 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 591 | bool hasIntegratedCPP() const override { return false; } |
| 592 | bool isLinkJob() const override { return true; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 593 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 594 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 595 | const InputInfo &Output, const InputInfoList &Inputs, |
| 596 | const llvm::opt::ArgList &TCArgs, |
| 597 | const char *LinkingOutput) const override; |
| 598 | }; |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 599 | } // end namespace minix |
| 600 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 601 | /// solaris -- Directly call Solaris assembler and linker |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 602 | namespace solaris { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 603 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 604 | public: |
| 605 | Assembler(const ToolChain &TC) |
| 606 | : Tool("solaris::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 609 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 610 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 611 | const InputInfo &Output, const InputInfoList &Inputs, |
| 612 | const llvm::opt::ArgList &TCArgs, |
| 613 | const char *LinkingOutput) const override; |
| 614 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 615 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 616 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 617 | public: |
| 618 | Linker(const ToolChain &TC) : Tool("solaris::Linker", "linker", TC) {} |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 619 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 620 | bool hasIntegratedCPP() const override { return false; } |
| 621 | bool isLinkJob() const override { return true; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 622 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 623 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 624 | const InputInfo &Output, const InputInfoList &Inputs, |
| 625 | const llvm::opt::ArgList &TCArgs, |
| 626 | const char *LinkingOutput) const override; |
| 627 | }; |
David Chisnall | a9ed5d7 | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 628 | } // end namespace solaris |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 629 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 630 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 631 | namespace dragonfly { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 632 | class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { |
| 633 | public: |
| 634 | Assembler(const ToolChain &TC) |
| 635 | : GnuTool("dragonfly::Assembler", "assembler", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 638 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 639 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 640 | const InputInfo &Output, const InputInfoList &Inputs, |
| 641 | const llvm::opt::ArgList &TCArgs, |
| 642 | const char *LinkingOutput) const override; |
| 643 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 644 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 645 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 646 | public: |
| 647 | Linker(const ToolChain &TC) : GnuTool("dragonfly::Linker", "linker", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 648 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 649 | bool hasIntegratedCPP() const override { return false; } |
| 650 | bool isLinkJob() const override { return true; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 651 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 652 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 653 | const InputInfo &Output, const InputInfoList &Inputs, |
| 654 | const llvm::opt::ArgList &TCArgs, |
| 655 | const char *LinkingOutput) const override; |
| 656 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 657 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 658 | |
Hans Wennborg | 1da044a | 2014-06-26 19:59:02 +0000 | [diff] [blame] | 659 | /// Visual studio tools. |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 660 | namespace visualstudio { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 661 | VersionTuple getMSVCVersion(const Driver *D, const llvm::Triple &Triple, |
| 662 | const llvm::opt::ArgList &Args, bool IsWindowsMSVC); |
David Majnemer | e11d373 | 2015-06-08 00:22:46 +0000 | [diff] [blame] | 663 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 664 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 665 | public: |
| 666 | Linker(const ToolChain &TC) |
| 667 | : Tool("visualstudio::Linker", "linker", TC, RF_Full, |
| 668 | llvm::sys::WEM_UTF16) {} |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 669 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 670 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 671 | bool isLinkJob() const override { return true; } |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 672 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 673 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 674 | const InputInfo &Output, const InputInfoList &Inputs, |
| 675 | const llvm::opt::ArgList &TCArgs, |
| 676 | const char *LinkingOutput) const override; |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 677 | }; |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 678 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 679 | class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { |
| 680 | public: |
| 681 | Compiler(const ToolChain &TC) |
| 682 | : Tool("visualstudio::Compiler", "compiler", TC, RF_Full, |
| 683 | llvm::sys::WEM_UTF16) {} |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 684 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 685 | bool hasIntegratedAssembler() const override { return true; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 686 | bool hasIntegratedCPP() const override { return true; } |
| 687 | bool isLinkJob() const override { return false; } |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 688 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 689 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 690 | const InputInfo &Output, const InputInfoList &Inputs, |
| 691 | const llvm::opt::ArgList &TCArgs, |
| 692 | const char *LinkingOutput) const override; |
Hans Wennborg | 87cfa71 | 2013-09-19 20:32:16 +0000 | [diff] [blame] | 693 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 694 | std::unique_ptr<Command> GetCommand(Compilation &C, const JobAction &JA, |
| 695 | const InputInfo &Output, |
| 696 | const InputInfoList &Inputs, |
| 697 | const llvm::opt::ArgList &TCArgs, |
| 698 | const char *LinkingOutput) const; |
| 699 | }; |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 700 | } // end namespace visualstudio |
| 701 | |
Yaron Keren | 1c0070c | 2015-07-02 04:45:27 +0000 | [diff] [blame] | 702 | /// MinGW -- Directly call GNU Binutils assembler and linker |
| 703 | namespace MinGW { |
| 704 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 705 | public: |
| 706 | Assembler(const ToolChain &TC) : Tool("MinGW::Assemble", "assembler", TC) {} |
| 707 | |
| 708 | bool hasIntegratedCPP() const override { return false; } |
| 709 | |
| 710 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 711 | const InputInfo &Output, const InputInfoList &Inputs, |
| 712 | const llvm::opt::ArgList &TCArgs, |
| 713 | const char *LinkingOutput) const override; |
| 714 | }; |
| 715 | |
| 716 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 717 | public: |
| 718 | Linker(const ToolChain &TC) : Tool("MinGW::Linker", "linker", TC) {} |
| 719 | |
| 720 | bool hasIntegratedCPP() const override { return false; } |
| 721 | bool isLinkJob() const override { return true; } |
| 722 | |
| 723 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 724 | const InputInfo &Output, const InputInfoList &Inputs, |
| 725 | const llvm::opt::ArgList &TCArgs, |
| 726 | const char *LinkingOutput) const override; |
| 727 | |
| 728 | private: |
| 729 | void AddLibGCC(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const; |
| 730 | }; |
| 731 | } // end namespace MinGW |
| 732 | |
Tim Northover | 9c7e035 | 2013-12-12 11:55:52 +0000 | [diff] [blame] | 733 | namespace arm { |
Saleem Abdulrasool | eee54b4 | 2015-09-18 05:32:23 +0000 | [diff] [blame] | 734 | enum class FloatABI { |
| 735 | Invalid, |
| 736 | Soft, |
| 737 | SoftFP, |
| 738 | Hard, |
| 739 | }; |
| 740 | |
Saleem Abdulrasool | 06f6f99 | 2015-09-19 20:40:16 +0000 | [diff] [blame] | 741 | FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args); |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 742 | } // end namespace arm |
| 743 | |
Robert Lytton | cf1dd69 | 2013-10-11 10:29:40 +0000 | [diff] [blame] | 744 | namespace XCore { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 745 | // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and |
| 746 | // Compile. |
| 747 | // We simply use "clang -cc1" for those actions. |
| 748 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 749 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 750 | Assembler(const ToolChain &TC) : Tool("XCore::Assembler", "XCore-as", TC) {} |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 751 | |
| 752 | bool hasIntegratedCPP() const override { return false; } |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 753 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 754 | const InputInfo &Output, const InputInfoList &Inputs, |
| 755 | const llvm::opt::ArgList &TCArgs, |
| 756 | const char *LinkingOutput) const override; |
| 757 | }; |
| 758 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 759 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 760 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 761 | Linker(const ToolChain &TC) : Tool("XCore::Linker", "XCore-ld", TC) {} |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 762 | |
| 763 | bool hasIntegratedCPP() const override { return false; } |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 764 | bool isLinkJob() const override { return true; } |
| 765 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 766 | const InputInfo &Output, const InputInfoList &Inputs, |
| 767 | const llvm::opt::ArgList &TCArgs, |
| 768 | const char *LinkingOutput) const override; |
| 769 | }; |
| 770 | } // end namespace XCore. |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 771 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 772 | namespace CrossWindows { |
| 773 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 774 | public: |
| 775 | Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {} |
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 | bool hasIntegratedCPP() const override { return false; } |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 778 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 779 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 780 | const InputInfo &Output, const InputInfoList &Inputs, |
| 781 | const llvm::opt::ArgList &TCArgs, |
| 782 | const char *LinkingOutput) const override; |
| 783 | }; |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 784 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 785 | class LLVM_LIBRARY_VISIBILITY Linker : public Tool { |
| 786 | public: |
| 787 | Linker(const ToolChain &TC) |
| 788 | : Tool("CrossWindows::Linker", "ld", TC, RF_Full) {} |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 789 | |
Reid Kleckner | bac59a1 | 2015-07-15 17:58:55 +0000 | [diff] [blame] | 790 | bool hasIntegratedCPP() const override { return false; } |
| 791 | bool isLinkJob() const override { return true; } |
Saleem Abdulrasool | 543a78b | 2014-10-24 03:13:37 +0000 | [diff] [blame] | 792 | |
| 793 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 794 | const InputInfo &Output, const InputInfoList &Inputs, |
| 795 | const llvm::opt::ArgList &TCArgs, |
| 796 | const char *LinkingOutput) const override; |
| 797 | }; |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 798 | } // end namespace CrossWindows |
Robert Lytton | cf1dd69 | 2013-10-11 10:29:40 +0000 | [diff] [blame] | 799 | |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 800 | /// SHAVE tools -- Directly call moviCompile and moviAsm |
| 801 | namespace SHAVE { |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 802 | class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 803 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 804 | Compiler(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {} |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 805 | |
| 806 | bool hasIntegratedCPP() const override { return true; } |
| 807 | |
| 808 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 809 | const InputInfo &Output, const InputInfoList &Inputs, |
| 810 | const llvm::opt::ArgList &TCArgs, |
| 811 | const char *LinkingOutput) const override; |
| 812 | }; |
| 813 | |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 814 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 815 | public: |
Douglas Katzman | 9535429 | 2015-06-23 20:42:09 +0000 | [diff] [blame] | 816 | Assembler(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {} |
Douglas Katzman | 84a7564 | 2015-06-19 14:55:19 +0000 | [diff] [blame] | 817 | |
| 818 | bool hasIntegratedCPP() const override { return false; } // not sure. |
| 819 | |
| 820 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 821 | const InputInfo &Output, const InputInfoList &Inputs, |
| 822 | const llvm::opt::ArgList &TCArgs, |
| 823 | const char *LinkingOutput) const override; |
| 824 | }; |
| 825 | } // end namespace SHAVE |
| 826 | |
Douglas Katzman | d6e597c | 2015-09-17 19:56:40 +0000 | [diff] [blame] | 827 | /// The Myriad toolchain uses tools that are in two different namespaces. |
| 828 | /// The Compiler and Assembler as defined above are in the SHAVE namespace, |
| 829 | /// whereas the linker, which accepts code for a mixture of Sparc and SHAVE, |
| 830 | /// is in the Myriad namespace. |
| 831 | namespace Myriad { |
| 832 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 833 | public: |
| 834 | Linker(const ToolChain &TC) : GnuTool("shave::Linker", "ld", TC) {} |
| 835 | bool hasIntegratedCPP() const override { return false; } |
| 836 | bool isLinkJob() const override { return true; } |
| 837 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 838 | const InputInfo &Output, const InputInfoList &Inputs, |
| 839 | const llvm::opt::ArgList &TCArgs, |
| 840 | const char *LinkingOutput) const override; |
| 841 | }; |
| 842 | } // end namespace Myriad |
| 843 | |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 844 | namespace PS4cpu { |
| 845 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 846 | public: |
| 847 | Assemble(const ToolChain &TC) |
| 848 | : Tool("PS4cpu::Assemble", "assembler", TC, RF_Full) {} |
| 849 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 850 | bool hasIntegratedCPP() const override { return false; } |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 851 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 852 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 853 | const InputInfo &Output, |
| 854 | const InputInfoList &Inputs, |
| 855 | const llvm::opt::ArgList &TCArgs, |
| 856 | const char *LinkingOutput) const override; |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 857 | }; |
| 858 | |
| 859 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 860 | public: |
| 861 | Link(const ToolChain &TC) : Tool("PS4cpu::Link", "linker", TC, RF_Full) {} |
| 862 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 863 | bool hasIntegratedCPP() const override { return false; } |
| 864 | bool isLinkJob() const override { return true; } |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 865 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 866 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 867 | const InputInfo &Output, |
| 868 | const InputInfoList &Inputs, |
| 869 | const llvm::opt::ArgList &TCArgs, |
| 870 | const char *LinkingOutput) const override; |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 871 | }; |
| 872 | } // end namespace PS4cpu |
| 873 | |
Douglas Katzman | 9dc5fbb | 2015-06-03 16:56:50 +0000 | [diff] [blame] | 874 | } // end namespace tools |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 875 | } // end namespace driver |
| 876 | } // end namespace clang |
| 877 | |
Eugene Zelenko | d4304d2 | 2015-11-04 21:37:17 +0000 | [diff] [blame] | 878 | #endif // LLVM_CLANG_LIB_DRIVER_TOOLS_H |