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