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