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