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