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