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