blob: 702fc9d5c36c6e5e73731819ac14a45e4e5ba3cc [file] [log] [blame]
Daniel Dunbar5903d8c2009-03-17 22:07:58 +00001//===--- 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 Dunbare6adeee2009-03-29 17:08:39 +000014#include "clang/Driver/Types.h"
Daniel Dunbara3246a02009-03-18 08:07:30 +000015#include "clang/Driver/Util.h"
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000016
Joerg Sonnenberger637603a2011-05-16 13:35:02 +000017#include "llvm/ADT/Triple.h"
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000018#include "llvm/Support/Compiler.h"
19
20namespace clang {
21namespace driver {
Douglas Gregor111af7d2009-04-18 00:34:01 +000022 class Driver;
23
Daniel Dunbarc1964212009-03-26 16:23:12 +000024namespace toolchains {
Daniel Dunbarf0a5b9b2009-09-04 18:34:51 +000025 class Darwin;
Daniel Dunbarc1964212009-03-26 16:23:12 +000026}
27
Daniel Dunbar15abb2e2009-03-17 22:18:43 +000028namespace tools {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000029
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000030 /// \brief Clang compiler tool.
Duncan Sandsaf260b92010-05-11 20:16:05 +000031 class LLVM_LIBRARY_VISIBILITY Clang : public Tool {
Douglas Gregor111af7d2009-04-18 00:34:01 +000032 void AddPreprocessingOptions(const Driver &D,
33 const ArgList &Args,
Daniel Dunbard067f7f2009-04-08 23:54:23 +000034 ArgStringList &CmdArgs,
35 const InputInfo &Output,
36 const InputInfoList &Inputs) const;
37
Daniel Dunbarc9388c12011-03-17 17:10:06 +000038 void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs,
39 bool KernelOrKext) const;
Eric Christopher0b26a612010-03-02 02:41:08 +000040 void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Bruno Cardoso Lopese7f211c2010-11-09 17:21:19 +000041 void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbar3b3191f2009-09-09 22:33:08 +000042 void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
43
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000044 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000045 Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000046
Daniel Dunbar3d45e172010-04-06 17:07:49 +000047 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbarc4343942010-02-03 03:07:56 +000048 virtual bool hasIntegratedAssembler() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000049 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +000050
51 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +000052 const InputInfo &Output,
53 const InputInfoList &Inputs,
54 const ArgList &TCArgs,
Daniel Dunbar1a093d22009-03-18 06:00:36 +000055 const char *LinkingOutput) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000056 };
57
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000058 /// \brief Clang integrated assembler tool.
59 class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool {
60 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000061 ClangAs(const ToolChain &TC) : Tool("clang::as",
62 "clang integrated assembler", TC) {}
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000063
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000064 virtual bool hasGoodDiagnostics() const { return true; }
65 virtual bool hasIntegratedAssembler() const { return false; }
66 virtual bool hasIntegratedCPP() const { return false; }
67
68 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000069 const InputInfo &Output,
70 const InputInfoList &Inputs,
71 const ArgList &TCArgs,
72 const char *LinkingOutput) const;
73 };
74
Daniel Dunbar82116f82009-03-17 22:45:24 +000075 /// gcc - Generic GCC tool implementations.
76namespace gcc {
Duncan Sandsaf260b92010-05-11 20:16:05 +000077 class LLVM_LIBRARY_VISIBILITY Common : public Tool {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000078 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000079 Common(const char *Name, const char *ShortName,
80 const ToolChain &TC) : Tool(Name, ShortName, TC) {}
Daniel Dunbara3246a02009-03-18 08:07:30 +000081
82 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +000083 const InputInfo &Output,
84 const InputInfoList &Inputs,
85 const ArgList &TCArgs,
Daniel Dunbara3246a02009-03-18 08:07:30 +000086 const char *LinkingOutput) const;
87
88 /// RenderExtraToolArgs - Render any arguments necessary to force
89 /// the particular tool mode.
Daniel Dunbar4e295052010-01-25 22:35:08 +000090 virtual void RenderExtraToolArgs(const JobAction &JA,
91 ArgStringList &CmdArgs) const = 0;
Daniel Dunbara3246a02009-03-18 08:07:30 +000092 };
93
Mike Stump11289f42009-09-09 15:08:12 +000094
Duncan Sandsaf260b92010-05-11 20:16:05 +000095 class LLVM_LIBRARY_VISIBILITY Preprocess : public Common {
Daniel Dunbara3246a02009-03-18 08:07:30 +000096 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000097 Preprocess(const ToolChain &TC) : Common("gcc::Preprocess",
98 "gcc preprocessor", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000099
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000100 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000101 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000102
Daniel Dunbar4e295052010-01-25 22:35:08 +0000103 virtual void RenderExtraToolArgs(const JobAction &JA,
104 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000105 };
106
Duncan Sandsaf260b92010-05-11 20:16:05 +0000107 class LLVM_LIBRARY_VISIBILITY Precompile : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000108 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000109 Precompile(const ToolChain &TC) : Common("gcc::Precompile",
110 "gcc precompile", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000111
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000112 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000113 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000114
Daniel Dunbar4e295052010-01-25 22:35:08 +0000115 virtual void RenderExtraToolArgs(const JobAction &JA,
116 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000117 };
118
Duncan Sandsaf260b92010-05-11 20:16:05 +0000119 class LLVM_LIBRARY_VISIBILITY Compile : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000120 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000121 Compile(const ToolChain &TC) : Common("gcc::Compile",
122 "gcc frontend", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000123
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000124 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000125 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000126
Daniel Dunbar4e295052010-01-25 22:35:08 +0000127 virtual void RenderExtraToolArgs(const JobAction &JA,
128 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000129 };
130
Duncan Sandsaf260b92010-05-11 20:16:05 +0000131 class LLVM_LIBRARY_VISIBILITY Assemble : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000132 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000133 Assemble(const ToolChain &TC) : Common("gcc::Assemble",
134 "assembler (via gcc)", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000135
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000136 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000137
Daniel Dunbar4e295052010-01-25 22:35:08 +0000138 virtual void RenderExtraToolArgs(const JobAction &JA,
139 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000140 };
141
Duncan Sandsaf260b92010-05-11 20:16:05 +0000142 class LLVM_LIBRARY_VISIBILITY Link : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000143 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000144 Link(const ToolChain &TC) : Common("gcc::Link",
145 "linker (via gcc)", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000146
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000147 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000148
Daniel Dunbar4e295052010-01-25 22:35:08 +0000149 virtual void RenderExtraToolArgs(const JobAction &JA,
150 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000151 };
Daniel Dunbar82116f82009-03-17 22:45:24 +0000152} // end namespace gcc
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000153
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000154namespace darwin {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000155 class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool {
Daniel Dunbare9ded432009-09-09 18:36:20 +0000156 protected:
157 void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare9ded432009-09-09 18:36:20 +0000158
159 const toolchains::Darwin &getDarwinToolChain() const {
160 return reinterpret_cast<const toolchains::Darwin&>(getToolChain());
161 }
162
163 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000164 DarwinTool(const char *Name, const char *ShortName,
165 const ToolChain &TC) : Tool(Name, ShortName, TC) {}
Daniel Dunbare9ded432009-09-09 18:36:20 +0000166 };
167
Duncan Sandsaf260b92010-05-11 20:16:05 +0000168 class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool {
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000169 public:
Mike Stump11289f42009-09-09 15:08:12 +0000170 static const char *getBaseInputName(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000171 const InputInfoList &Input);
Mike Stump11289f42009-09-09 15:08:12 +0000172 static const char *getBaseInputStem(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000173 const InputInfoList &Input);
Mike Stump11289f42009-09-09 15:08:12 +0000174 static const char *getDependencyFileName(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000175 const InputInfoList &Inputs);
176
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000177 protected:
178 const char *getCC1Name(types::ID Type) const;
179
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000180 void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const;
Chad Rosierbc5ea3d2011-08-17 18:24:55 +0000181 void RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000182 void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
183 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000184 const ArgStringList &OutputArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000185 void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
186 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000187 const ArgStringList &OutputArgs) const;
Mike Stump11289f42009-09-09 15:08:12 +0000188 void AddCPPUniqueOptionsArgs(const ArgList &Args,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000189 ArgStringList &CmdArgs,
190 const InputInfoList &Inputs) const;
191 void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000192
193 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000194 CC1(const char *Name, const char *ShortName,
195 const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000196
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000197 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000198 virtual bool hasIntegratedCPP() const { return true; }
199 };
200
Duncan Sandsaf260b92010-05-11 20:16:05 +0000201 class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000202 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000203 Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess",
204 "gcc preprocessor", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000205
206 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000207 const InputInfo &Output,
208 const InputInfoList &Inputs,
209 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000210 const char *LinkingOutput) const;
211 };
212
Duncan Sandsaf260b92010-05-11 20:16:05 +0000213 class LLVM_LIBRARY_VISIBILITY Compile : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000214 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000215 Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000216
217 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000218 const InputInfo &Output,
219 const InputInfoList &Inputs,
220 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000221 const char *LinkingOutput) const;
222 };
223
Duncan Sandsaf260b92010-05-11 20:16:05 +0000224 class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool {
Daniel Dunbarbe220842009-03-20 16:06:39 +0000225 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000226 Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble",
227 "assembler", TC) {}
Daniel Dunbarbe220842009-03-20 16:06:39 +0000228
Daniel Dunbarbe220842009-03-20 16:06:39 +0000229 virtual bool hasIntegratedCPP() const { return false; }
230
231 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000232 const InputInfo &Output,
233 const InputInfoList &Inputs,
234 const ArgList &TCArgs,
Daniel Dunbarbe220842009-03-20 16:06:39 +0000235 const char *LinkingOutput) const;
236 };
237
Duncan Sandsaf260b92010-05-11 20:16:05 +0000238 class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool {
Daniel Dunbarccbc4522010-09-09 21:51:05 +0000239 void AddLinkArgs(Compilation &C, const ArgList &Args,
240 ArgStringList &CmdArgs) const;
Daniel Dunbarc1964212009-03-26 16:23:12 +0000241
Daniel Dunbarc1964212009-03-26 16:23:12 +0000242 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000243 Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {}
Daniel Dunbarc1964212009-03-26 16:23:12 +0000244
Daniel Dunbarc1964212009-03-26 16:23:12 +0000245 virtual bool hasIntegratedCPP() const { return false; }
246
247 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000248 const InputInfo &Output,
249 const InputInfoList &Inputs,
250 const ArgList &TCArgs,
Daniel Dunbarc1964212009-03-26 16:23:12 +0000251 const char *LinkingOutput) const;
252 };
253
Duncan Sandsaf260b92010-05-11 20:16:05 +0000254 class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool {
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000255 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000256 Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {}
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000257
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000258 virtual bool hasIntegratedCPP() const { return false; }
259
260 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000261 const InputInfo &Output,
262 const InputInfoList &Inputs,
263 const ArgList &TCArgs,
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000264 const char *LinkingOutput) const;
265 };
Daniel Dunbar88299622010-06-04 18:28:36 +0000266
267 class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool {
268 public:
269 Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil",
270 "dsymutil", TC) {}
271
Daniel Dunbar88299622010-06-04 18:28:36 +0000272 virtual bool hasIntegratedCPP() const { return false; }
273
274 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Daniel Dunbar88299622010-06-04 18:28:36 +0000275 const InputInfo &Output,
276 const InputInfoList &Inputs,
277 const ArgList &TCArgs,
278 const char *LinkingOutput) const;
279 };
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000280}
281
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000282 /// openbsd -- Directly call GNU Binutils assembler and linker
283namespace openbsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000284 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000285 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000286 Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler",
287 TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000288
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000289 virtual bool hasIntegratedCPP() const { return false; }
290
291 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000292 const InputInfo &Output,
293 const InputInfoList &Inputs,
294 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000295 const char *LinkingOutput) const;
296 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000297 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000298 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000299 Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000300
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000301 virtual bool hasIntegratedCPP() const { return false; }
302
303 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000304 const InputInfo &Output,
305 const InputInfoList &Inputs,
306 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000307 const char *LinkingOutput) const;
308 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000309} // end namespace openbsd
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000310
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000311 /// freebsd -- Directly call GNU Binutils assembler and linker
312namespace freebsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000313 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000314 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000315 Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler",
316 TC) {}
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000317
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000318 virtual bool hasIntegratedCPP() const { return false; }
319
320 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000321 const InputInfo &Output,
322 const InputInfoList &Inputs,
323 const ArgList &TCArgs,
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000324 const char *LinkingOutput) const;
325 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000326 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000327 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000328 Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {}
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000329
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000330 virtual bool hasIntegratedCPP() const { return false; }
331
332 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000333 const InputInfo &Output,
334 const InputInfoList &Inputs,
335 const ArgList &TCArgs,
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000336 const char *LinkingOutput) const;
337 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000338} // end namespace freebsd
339
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000340 /// netbsd -- Directly call GNU Binutils assembler and linker
341namespace netbsd {
342 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000343 private:
344 const llvm::Triple ToolTriple;
345
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000346 public:
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000347 Assemble(const ToolChain &TC, const llvm::Triple &ToolTriple)
348 : Tool("netbsd::Assemble", "assembler", TC), ToolTriple(ToolTriple) {}
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000349
350 virtual bool hasIntegratedCPP() const { return false; }
351
352 virtual void ConstructJob(Compilation &C, const JobAction &JA,
353 const InputInfo &Output,
354 const InputInfoList &Inputs,
355 const ArgList &TCArgs,
356 const char *LinkingOutput) const;
357 };
358 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000359 private:
360 const llvm::Triple ToolTriple;
361
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000362 public:
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000363 Link(const ToolChain &TC, const llvm::Triple &ToolTriple)
Joerg Sonnenberger4eb724f2011-06-21 08:45:08 +0000364 : Tool("netbsd::Link", "linker", TC), ToolTriple(ToolTriple) {}
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000365
366 virtual bool hasIntegratedCPP() const { return false; }
367
368 virtual void ConstructJob(Compilation &C, const JobAction &JA,
369 const InputInfo &Output,
370 const InputInfoList &Inputs,
371 const ArgList &TCArgs,
372 const char *LinkingOutput) const;
373 };
374} // end namespace netbsd
375
Rafael Espindola92b00932010-08-10 00:25:48 +0000376 /// linux -- Directly call GNU Binutils assembler and linker
377namespace linuxtools {
378 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
379 public:
380 Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler",
381 TC) {}
382
383 virtual bool hasIntegratedCPP() const { return false; }
384
385 virtual void ConstructJob(Compilation &C, const JobAction &JA,
386 const InputInfo &Output,
387 const InputInfoList &Inputs,
388 const ArgList &TCArgs,
389 const char *LinkingOutput) const;
390 };
Rafael Espindolac8f008f2010-11-07 20:14:31 +0000391 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
392 public:
393 Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {}
394
395 virtual bool hasIntegratedCPP() const { return false; }
396
397 virtual void ConstructJob(Compilation &C, const JobAction &JA,
398 const InputInfo &Output,
399 const InputInfoList &Inputs,
400 const ArgList &TCArgs,
401 const char *LinkingOutput) const;
402 };
Rafael Espindola92b00932010-08-10 00:25:48 +0000403}
Chris Lattner3e2ee142010-07-07 16:01:42 +0000404 /// minix -- Directly call GNU Binutils assembler and linker
405namespace minix {
406 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
407 public:
408 Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler",
409 TC) {}
410
Chris Lattner3e2ee142010-07-07 16:01:42 +0000411 virtual bool hasIntegratedCPP() const { return false; }
412
413 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000414 const InputInfo &Output,
415 const InputInfoList &Inputs,
416 const ArgList &TCArgs,
417 const char *LinkingOutput) const;
418 };
419 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
420 public:
421 Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {}
422
Chris Lattner3e2ee142010-07-07 16:01:42 +0000423 virtual bool hasIntegratedCPP() const { return false; }
424
425 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000426 const InputInfo &Output,
427 const InputInfoList &Inputs,
428 const ArgList &TCArgs,
429 const char *LinkingOutput) const;
430 };
431} // end namespace minix
432
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000433 /// auroraux -- Directly call GNU Binutils assembler and linker
434namespace auroraux {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000435 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000436 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000437 Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler",
438 TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000439
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000440 virtual bool hasIntegratedCPP() const { return false; }
441
442 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000443 const InputInfo &Output,
444 const InputInfoList &Inputs,
445 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000446 const char *LinkingOutput) const;
447 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000448 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000449 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000450 Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000451
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000452 virtual bool hasIntegratedCPP() const { return false; }
453
454 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000455 const InputInfo &Output,
456 const InputInfoList &Inputs,
457 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000458 const char *LinkingOutput) const;
459 };
460} // end namespace auroraux
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000461
Daniel Dunbarcc912342009-05-02 18:28:39 +0000462 /// dragonfly -- Directly call GNU Binutils assembler and linker
463namespace dragonfly {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000464 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000465 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000466 Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler",
467 TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000468
Daniel Dunbarcc912342009-05-02 18:28:39 +0000469 virtual bool hasIntegratedCPP() const { return false; }
470
471 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000472 const InputInfo &Output,
473 const InputInfoList &Inputs,
474 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000475 const char *LinkingOutput) const;
476 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000477 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000478 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000479 Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000480
Daniel Dunbarcc912342009-05-02 18:28:39 +0000481 virtual bool hasIntegratedCPP() const { return false; }
482
483 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000484 const InputInfo &Output,
485 const InputInfoList &Inputs,
486 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000487 const char *LinkingOutput) const;
488 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000489} // end namespace dragonfly
Daniel Dunbarcc912342009-05-02 18:28:39 +0000490
Michael J. Spencerb186bc32010-08-21 21:55:07 +0000491 /// Visual studio tools.
492namespace visualstudio {
493 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
494 public:
495 Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {}
496
497 virtual bool hasIntegratedCPP() const { return false; }
498
499 virtual void ConstructJob(Compilation &C, const JobAction &JA,
500 const InputInfo &Output,
501 const InputInfoList &Inputs,
502 const ArgList &TCArgs,
503 const char *LinkingOutput) const;
504 };
505} // end namespace visualstudio
506
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000507} // end namespace toolchains
508} // end namespace driver
509} // end namespace clang
510
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000511#endif // CLANG_LIB_DRIVER_TOOLS_H_