Daniel Dunbar | 9c073ff | 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 | |
| 10 | #ifndef CLANG_LIB_DRIVER_TOOLS_H_ |
| 11 | #define CLANG_LIB_DRIVER_TOOLS_H_ |
| 12 | |
| 13 | #include "clang/Driver/Tool.h" |
Daniel Dunbar | 40f1265 | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 14 | #include "clang/Driver/Types.h" |
Daniel Dunbar | b488c1d | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 15 | #include "clang/Driver/Util.h" |
Joerg Sonnenberger | 182564c | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/Triple.h" |
Reid Kleckner | b1e25a1 | 2013-06-14 17:17:23 +0000 | [diff] [blame] | 17 | #include "llvm/Option/Option.h" |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Compiler.h" |
| 19 | |
| 20 | namespace clang { |
John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 21 | class ObjCRuntime; |
| 22 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 23 | namespace driver { |
Douglas Gregor | df91ef3 | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 24 | class Driver; |
| 25 | |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 26 | namespace toolchains { |
Daniel Dunbar | f395528 | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 27 | class Darwin; |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 28 | } |
| 29 | |
Daniel Dunbar | 985b825 | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 30 | namespace tools { |
Reid Kleckner | b1e25a1 | 2013-06-14 17:17:23 +0000 | [diff] [blame] | 31 | using llvm::opt::ArgStringList; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 32 | |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 33 | /// \brief Clang compiler tool. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 34 | class LLVM_LIBRARY_VISIBILITY Clang : public Tool { |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 35 | public: |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 36 | static const char *getBaseInputName(const llvm::opt::ArgList &Args, |
Bob Wilson | 66b8a66 | 2012-11-23 06:14:39 +0000 | [diff] [blame] | 37 | const InputInfoList &Inputs); |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 38 | static const char *getBaseInputStem(const llvm::opt::ArgList &Args, |
Bob Wilson | 66b8a66 | 2012-11-23 06:14:39 +0000 | [diff] [blame] | 39 | const InputInfoList &Inputs); |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 40 | static const char *getDependencyFileName(const llvm::opt::ArgList &Args, |
Bob Wilson | 66b8a66 | 2012-11-23 06:14:39 +0000 | [diff] [blame] | 41 | const InputInfoList &Inputs); |
| 42 | |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 43 | private: |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 44 | void AddPreprocessingOptions(Compilation &C, const JobAction &JA, |
Peter Collingbourne | 54db68b | 2011-11-06 00:40:05 +0000 | [diff] [blame] | 45 | const Driver &D, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 46 | const llvm::opt::ArgList &Args, |
| 47 | llvm::opt::ArgStringList &CmdArgs, |
Daniel Dunbar | c21c485 | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 48 | const InputInfo &Output, |
| 49 | const InputInfoList &Inputs) const; |
| 50 | |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 51 | void AddARMTargetArgs(const llvm::opt::ArgList &Args, |
| 52 | llvm::opt::ArgStringList &CmdArgs, |
Daniel Dunbar | fa41d69 | 2011-03-17 17:10:06 +0000 | [diff] [blame] | 53 | bool KernelOrKext) const; |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 54 | void AddMIPSTargetArgs(const llvm::opt::ArgList &Args, |
| 55 | llvm::opt::ArgStringList &CmdArgs) const; |
| 56 | void AddPPCTargetArgs(const llvm::opt::ArgList &Args, |
| 57 | llvm::opt::ArgStringList &CmdArgs) const; |
| 58 | void AddR600TargetArgs(const llvm::opt::ArgList &Args, |
| 59 | llvm::opt::ArgStringList &CmdArgs) const; |
| 60 | void AddSparcTargetArgs(const llvm::opt::ArgList &Args, |
| 61 | llvm::opt::ArgStringList &CmdArgs) const; |
Richard Sandiford | 5c92b9a | 2013-07-19 16:51:51 +0000 | [diff] [blame] | 62 | void AddSystemZTargetArgs(const llvm::opt::ArgList &Args, |
| 63 | llvm::opt::ArgStringList &CmdArgs) const; |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 64 | void AddX86TargetArgs(const llvm::opt::ArgList &Args, |
| 65 | llvm::opt::ArgStringList &CmdArgs) const; |
| 66 | void AddHexagonTargetArgs(const llvm::opt::ArgList &Args, |
| 67 | llvm::opt::ArgStringList &CmdArgs) const; |
Tim Northover | b793f0d | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 68 | void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, |
| 69 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 6acda16 | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 70 | |
John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 71 | enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile }; |
| 72 | |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 73 | ObjCRuntime AddObjCRuntimeArgs(const llvm::opt::ArgList &args, |
| 74 | llvm::opt::ArgStringList &cmdArgs, |
John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 75 | RewriteKind rewrite) const; |
| 76 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 77 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 78 | Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 79 | |
Daniel Dunbar | 60a53f2 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 80 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 8767cbc | 2010-02-03 03:07:56 +0000 | [diff] [blame] | 81 | virtual bool hasIntegratedAssembler() const { return true; } |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 82 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 83 | |
| 84 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 85 | const InputInfo &Output, |
| 86 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 87 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 88 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 89 | }; |
| 90 | |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 91 | /// \brief Clang integrated assembler tool. |
| 92 | class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 93 | void AddARMTargetArgs(const llvm::opt::ArgList &Args, |
| 94 | llvm::opt::ArgStringList &CmdArgs) const; |
| 95 | void AddX86TargetArgs(const llvm::opt::ArgList &Args, |
| 96 | llvm::opt::ArgStringList &CmdArgs) const; |
| 97 | |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 98 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 99 | ClangAs(const ToolChain &TC) : Tool("clang::as", |
| 100 | "clang integrated assembler", TC) {} |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 101 | |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 102 | virtual bool hasGoodDiagnostics() const { return true; } |
| 103 | virtual bool hasIntegratedAssembler() const { return false; } |
| 104 | virtual bool hasIntegratedCPP() const { return false; } |
| 105 | |
| 106 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 107 | const InputInfo &Output, |
| 108 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 109 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 20a9aa5 | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 110 | const char *LinkingOutput) const; |
| 111 | }; |
| 112 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 113 | /// gcc - Generic GCC tool implementations. |
| 114 | namespace gcc { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 115 | class LLVM_LIBRARY_VISIBILITY Common : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 116 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 117 | Common(const char *Name, const char *ShortName, |
| 118 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | b488c1d | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 119 | |
| 120 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 121 | const InputInfo &Output, |
| 122 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 123 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | b488c1d | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 124 | const char *LinkingOutput) const; |
| 125 | |
| 126 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 127 | /// the particular tool mode. |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 128 | virtual void |
| 129 | RenderExtraToolArgs(const JobAction &JA, |
| 130 | llvm::opt::ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | b488c1d | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 131 | }; |
| 132 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 133 | class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { |
Daniel Dunbar | b488c1d | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 134 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 135 | Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", |
| 136 | "gcc preprocessor", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 137 | |
Daniel Dunbar | 60a53f2 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 138 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 139 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 140 | |
Daniel Dunbar | 82b51cc | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 141 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 142 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 143 | }; |
| 144 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 145 | class LLVM_LIBRARY_VISIBILITY Precompile : public Common { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 146 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 147 | Precompile(const ToolChain &TC) : Common("gcc::Precompile", |
| 148 | "gcc precompile", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 149 | |
Daniel Dunbar | 60a53f2 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 150 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 151 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 152 | |
Daniel Dunbar | 82b51cc | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 153 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 154 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 157 | class LLVM_LIBRARY_VISIBILITY Compile : public Common { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 158 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 159 | Compile(const ToolChain &TC) : Common("gcc::Compile", |
| 160 | "gcc frontend", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 161 | |
Daniel Dunbar | 60a53f2 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 162 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 163 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 164 | |
Daniel Dunbar | 82b51cc | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 165 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 166 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 167 | }; |
| 168 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 169 | class LLVM_LIBRARY_VISIBILITY Assemble : public Common { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 170 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 171 | Assemble(const ToolChain &TC) : Common("gcc::Assemble", |
| 172 | "assembler (via gcc)", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 173 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 174 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 175 | |
Daniel Dunbar | 82b51cc | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 176 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 177 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 178 | }; |
| 179 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 180 | class LLVM_LIBRARY_VISIBILITY Link : public Common { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 181 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 182 | Link(const ToolChain &TC) : Common("gcc::Link", |
| 183 | "linker (via gcc)", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 184 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 185 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 186 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 187 | |
Daniel Dunbar | 82b51cc | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 188 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 189 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 190 | }; |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 191 | } // end namespace gcc |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 192 | |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 193 | namespace hexagon { |
| 194 | // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile. |
| 195 | // We simply use "clang -cc1" for those actions. |
| 196 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 197 | public: |
| 198 | Assemble(const ToolChain &TC) : Tool("hexagon::Assemble", |
| 199 | "hexagon-as", TC) {} |
| 200 | |
| 201 | virtual bool hasIntegratedCPP() const { return false; } |
| 202 | |
| 203 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 204 | llvm::opt::ArgStringList &CmdArgs) const; |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 205 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 206 | const InputInfo &Output, |
| 207 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 208 | const llvm::opt::ArgList &TCArgs, |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 209 | const char *LinkingOutput) const; |
| 210 | }; |
| 211 | |
| 212 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 213 | public: |
| 214 | Link(const ToolChain &TC) : Tool("hexagon::Link", |
| 215 | "hexagon-ld", TC) {} |
| 216 | |
| 217 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 218 | virtual bool isLinkJob() const { return true; } |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 219 | |
| 220 | virtual void RenderExtraToolArgs(const JobAction &JA, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 221 | llvm::opt::ArgStringList &CmdArgs) const; |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 222 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 223 | const InputInfo &Output, |
| 224 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 225 | const llvm::opt::ArgList &TCArgs, |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 226 | const char *LinkingOutput) const; |
| 227 | }; |
| 228 | } // end namespace hexagon. |
| 229 | |
| 230 | |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 231 | namespace darwin { |
Rafael Espindola | cfed828 | 2012-10-31 18:51:07 +0000 | [diff] [blame] | 232 | llvm::Triple::ArchType getArchTypeForDarwinArchName(StringRef Str); |
| 233 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 234 | class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool { |
David Blaikie | 99ba9e3 | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 235 | virtual void anchor(); |
Daniel Dunbar | fbefe6b | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 236 | protected: |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 237 | void AddDarwinArch(const llvm::opt::ArgList &Args, |
| 238 | llvm::opt::ArgStringList &CmdArgs) const; |
Daniel Dunbar | fbefe6b | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 239 | |
| 240 | const toolchains::Darwin &getDarwinToolChain() const { |
| 241 | return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); |
| 242 | } |
| 243 | |
| 244 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 245 | DarwinTool(const char *Name, const char *ShortName, |
| 246 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | fbefe6b | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 247 | }; |
| 248 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 249 | class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool { |
Daniel Dunbar | 8cac5f7 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 250 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 251 | Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", |
| 252 | "assembler", TC) {} |
Daniel Dunbar | 8cac5f7 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 253 | |
Daniel Dunbar | 8cac5f7 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 254 | virtual bool hasIntegratedCPP() const { return false; } |
| 255 | |
| 256 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 257 | const InputInfo &Output, |
| 258 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 259 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 8cac5f7 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 260 | const char *LinkingOutput) const; |
| 261 | }; |
| 262 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 263 | class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { |
Bill Wendling | 6acf8b4 | 2012-10-02 18:02:50 +0000 | [diff] [blame] | 264 | bool NeedsTempPath(const InputInfoList &Inputs) const; |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 265 | void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, |
| 266 | llvm::opt::ArgStringList &CmdArgs, |
| 267 | const InputInfoList &Inputs) const; |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 268 | |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 269 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 270 | Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 271 | |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 272 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 273 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 274 | |
| 275 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 276 | const InputInfo &Output, |
| 277 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 278 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 279 | const char *LinkingOutput) const; |
| 280 | }; |
| 281 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 282 | class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool { |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 283 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 284 | Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 285 | |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 286 | virtual bool hasIntegratedCPP() const { return false; } |
| 287 | |
| 288 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 289 | const InputInfo &Output, |
| 290 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 291 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 292 | const char *LinkingOutput) const; |
| 293 | }; |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 294 | |
| 295 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool { |
| 296 | public: |
| 297 | Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil", |
| 298 | "dsymutil", TC) {} |
| 299 | |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 300 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 75dbc71 | 2013-02-01 18:30:26 +0000 | [diff] [blame] | 301 | virtual bool isDsymutilJob() const { return true; } |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 302 | |
| 303 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 304 | const InputInfo &Output, |
| 305 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 306 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 307 | const char *LinkingOutput) const; |
| 308 | }; |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 309 | |
| 310 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public DarwinTool { |
| 311 | public: |
| 312 | VerifyDebug(const ToolChain &TC) : DarwinTool("darwin::VerifyDebug", |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 313 | "dwarfdump", TC) {} |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 314 | |
| 315 | virtual bool hasIntegratedCPP() const { return false; } |
| 316 | |
| 317 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 318 | const InputInfo &Output, |
| 319 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 320 | const llvm::opt::ArgList &TCArgs, |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 321 | const char *LinkingOutput) const; |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 322 | }; |
| 323 | |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 324 | } |
| 325 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 326 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 327 | namespace openbsd { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 328 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 329 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 330 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler", |
| 331 | TC) {} |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 332 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 333 | virtual bool hasIntegratedCPP() const { return false; } |
| 334 | |
| 335 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 336 | const InputInfo &Output, |
| 337 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 338 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 339 | const char *LinkingOutput) const; |
| 340 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 341 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 342 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 343 | Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {} |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 344 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 345 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 346 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 347 | |
| 348 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 349 | const InputInfo &Output, |
| 350 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 351 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 352 | const char *LinkingOutput) const; |
| 353 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 354 | } // end namespace openbsd |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 355 | |
Eli Friedman | 42f74f2 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 356 | /// bitrig -- Directly call GNU Binutils assembler and linker |
| 357 | namespace bitrig { |
| 358 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 359 | public: |
| 360 | Assemble(const ToolChain &TC) : Tool("bitrig::Assemble", "assembler", |
| 361 | TC) {} |
| 362 | |
| 363 | virtual bool hasIntegratedCPP() const { return false; } |
| 364 | |
| 365 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 366 | const InputInfo &Output, |
| 367 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 368 | const llvm::opt::ArgList &TCArgs, |
Eli Friedman | 42f74f2 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 369 | const char *LinkingOutput) const; |
| 370 | }; |
| 371 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 372 | public: |
| 373 | Link(const ToolChain &TC) : Tool("bitrig::Link", "linker", TC) {} |
| 374 | |
| 375 | virtual bool hasIntegratedCPP() const { return false; } |
| 376 | virtual bool isLinkJob() const { return true; } |
| 377 | |
| 378 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 379 | const InputInfo &Output, |
| 380 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 381 | const llvm::opt::ArgList &TCArgs, |
Eli Friedman | 42f74f2 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 382 | const char *LinkingOutput) const; |
| 383 | }; |
| 384 | } // end namespace bitrig |
| 385 | |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 386 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 387 | namespace freebsd { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 388 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 389 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 390 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler", |
| 391 | TC) {} |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 392 | |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 393 | virtual bool hasIntegratedCPP() const { return false; } |
| 394 | |
| 395 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 396 | const InputInfo &Output, |
| 397 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 398 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 399 | const char *LinkingOutput) const; |
| 400 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 401 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 402 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 403 | Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {} |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 404 | |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 405 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 406 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 407 | |
| 408 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 409 | const InputInfo &Output, |
| 410 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 411 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 412 | const char *LinkingOutput) const; |
| 413 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 414 | } // end namespace freebsd |
| 415 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 416 | /// netbsd -- Directly call GNU Binutils assembler and linker |
| 417 | namespace netbsd { |
| 418 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Joerg Sonnenberger | 182564c | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 419 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 420 | public: |
Joerg Sonnenberger | 1bd9137 | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 421 | Assemble(const ToolChain &TC) |
| 422 | : Tool("netbsd::Assemble", "assembler", TC) {} |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 423 | |
| 424 | virtual bool hasIntegratedCPP() const { return false; } |
| 425 | |
| 426 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 427 | const InputInfo &Output, |
| 428 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 429 | const llvm::opt::ArgList &TCArgs, |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 430 | const char *LinkingOutput) const; |
| 431 | }; |
| 432 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Joerg Sonnenberger | 182564c | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 433 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 434 | public: |
Joerg Sonnenberger | 1bd9137 | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 435 | Link(const ToolChain &TC) |
| 436 | : Tool("netbsd::Link", "linker", TC) {} |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 437 | |
| 438 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 439 | virtual bool isLinkJob() const { return true; } |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 440 | |
| 441 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 442 | const InputInfo &Output, |
| 443 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 444 | const llvm::opt::ArgList &TCArgs, |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 445 | const char *LinkingOutput) const; |
| 446 | }; |
| 447 | } // end namespace netbsd |
| 448 | |
Thomas Schwinge | 577bb0a | 2013-03-28 19:04:25 +0000 | [diff] [blame] | 449 | /// Directly call GNU Binutils' assembler and linker. |
| 450 | namespace gnutools { |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 451 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 452 | public: |
Thomas Schwinge | 577bb0a | 2013-03-28 19:04:25 +0000 | [diff] [blame] | 453 | Assemble(const ToolChain &TC) : Tool("GNU::Assemble", "assembler", TC) {} |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 454 | |
| 455 | virtual bool hasIntegratedCPP() const { return false; } |
| 456 | |
| 457 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 458 | const InputInfo &Output, |
| 459 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 460 | const llvm::opt::ArgList &TCArgs, |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 461 | const char *LinkingOutput) const; |
| 462 | }; |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 463 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 464 | public: |
Thomas Schwinge | 577bb0a | 2013-03-28 19:04:25 +0000 | [diff] [blame] | 465 | Link(const ToolChain &TC) : Tool("GNU::Link", "linker", TC) {} |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 466 | |
| 467 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 468 | virtual bool isLinkJob() const { return true; } |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 469 | |
| 470 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 471 | const InputInfo &Output, |
| 472 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 473 | const llvm::opt::ArgList &TCArgs, |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 474 | const char *LinkingOutput) const; |
| 475 | }; |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 476 | } |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 477 | /// minix -- Directly call GNU Binutils assembler and linker |
| 478 | namespace minix { |
| 479 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 480 | public: |
| 481 | Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler", |
| 482 | TC) {} |
| 483 | |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 484 | virtual bool hasIntegratedCPP() const { return false; } |
| 485 | |
| 486 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 487 | const InputInfo &Output, |
| 488 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 489 | const llvm::opt::ArgList &TCArgs, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 490 | const char *LinkingOutput) const; |
| 491 | }; |
| 492 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 493 | public: |
| 494 | Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {} |
| 495 | |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 496 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 497 | virtual bool isLinkJob() const { return true; } |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 498 | |
| 499 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 500 | const InputInfo &Output, |
| 501 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 502 | const llvm::opt::ArgList &TCArgs, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 503 | const char *LinkingOutput) const; |
| 504 | }; |
| 505 | } // end namespace minix |
| 506 | |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 507 | /// solaris -- Directly call Solaris assembler and linker |
| 508 | namespace solaris { |
| 509 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 510 | public: |
| 511 | Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", |
| 512 | TC) {} |
| 513 | |
| 514 | virtual bool hasIntegratedCPP() const { return false; } |
| 515 | |
| 516 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 517 | const InputInfo &Output, |
| 518 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 519 | const llvm::opt::ArgList &TCArgs, |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 520 | const char *LinkingOutput) const; |
| 521 | }; |
| 522 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 523 | public: |
| 524 | Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} |
| 525 | |
| 526 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 527 | virtual bool isLinkJob() const { return true; } |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 528 | |
| 529 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 530 | const InputInfo &Output, |
| 531 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 532 | const llvm::opt::ArgList &TCArgs, |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 533 | const char *LinkingOutput) const; |
| 534 | }; |
David Chisnall | badb6cd | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 535 | } // end namespace solaris |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 536 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 537 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 538 | namespace auroraux { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 539 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 540 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 541 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler", |
| 542 | TC) {} |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 543 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 544 | virtual bool hasIntegratedCPP() const { return false; } |
| 545 | |
| 546 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 547 | const InputInfo &Output, |
| 548 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 549 | const llvm::opt::ArgList &TCArgs, |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 550 | const char *LinkingOutput) const; |
| 551 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 552 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 553 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 554 | Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {} |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 555 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 556 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 557 | virtual bool isLinkJob() const { return true; } |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 558 | |
| 559 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 560 | const InputInfo &Output, |
| 561 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 562 | const llvm::opt::ArgList &TCArgs, |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 563 | const char *LinkingOutput) const; |
| 564 | }; |
| 565 | } // end namespace auroraux |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 566 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 567 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 568 | namespace dragonfly { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 569 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 570 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 571 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler", |
| 572 | TC) {} |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 573 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 574 | virtual bool hasIntegratedCPP() const { return false; } |
| 575 | |
| 576 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 577 | const InputInfo &Output, |
| 578 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 579 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 580 | const char *LinkingOutput) const; |
| 581 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 582 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 583 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 584 | Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {} |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 585 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 586 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 587 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 588 | |
| 589 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 590 | const InputInfo &Output, |
| 591 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 592 | const llvm::opt::ArgList &TCArgs, |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 593 | const char *LinkingOutput) const; |
| 594 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 595 | } // end namespace dragonfly |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 596 | |
Michael J. Spencer | ff58e36 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 597 | /// Visual studio tools. |
| 598 | namespace visualstudio { |
| 599 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 600 | public: |
| 601 | Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} |
| 602 | |
| 603 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 604 | virtual bool isLinkJob() const { return true; } |
Michael J. Spencer | ff58e36 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 605 | |
| 606 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 607 | const InputInfo &Output, |
| 608 | const InputInfoList &Inputs, |
Reid Kleckner | dd0b3c4 | 2013-06-17 13:59:19 +0000 | [diff] [blame] | 609 | const llvm::opt::ArgList &TCArgs, |
Michael J. Spencer | ff58e36 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 610 | const char *LinkingOutput) const; |
| 611 | }; |
| 612 | } // end namespace visualstudio |
| 613 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 614 | } // end namespace toolchains |
| 615 | } // end namespace driver |
| 616 | } // end namespace clang |
| 617 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 618 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |