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