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