blob: 4a5a7e47452620254a4ca2fe0a2f72492acf6d90 [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;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000181 void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
182 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000183 const ArgStringList &OutputArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000184 void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
185 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000186 const ArgStringList &OutputArgs) const;
Mike Stump11289f42009-09-09 15:08:12 +0000187 void AddCPPUniqueOptionsArgs(const ArgList &Args,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000188 ArgStringList &CmdArgs,
189 const InputInfoList &Inputs) const;
190 void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000191
192 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000193 CC1(const char *Name, const char *ShortName,
194 const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000195
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000196 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000197 virtual bool hasIntegratedCPP() const { return true; }
198 };
199
Duncan Sandsaf260b92010-05-11 20:16:05 +0000200 class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000201 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000202 Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess",
203 "gcc preprocessor", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000204
205 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000206 const InputInfo &Output,
207 const InputInfoList &Inputs,
208 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000209 const char *LinkingOutput) const;
210 };
211
Duncan Sandsaf260b92010-05-11 20:16:05 +0000212 class LLVM_LIBRARY_VISIBILITY Compile : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000213 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000214 Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000215
216 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000217 const InputInfo &Output,
218 const InputInfoList &Inputs,
219 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000220 const char *LinkingOutput) const;
221 };
222
Duncan Sandsaf260b92010-05-11 20:16:05 +0000223 class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool {
Daniel Dunbarbe220842009-03-20 16:06:39 +0000224 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000225 Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble",
226 "assembler", TC) {}
Daniel Dunbarbe220842009-03-20 16:06:39 +0000227
Daniel Dunbarbe220842009-03-20 16:06:39 +0000228 virtual bool hasIntegratedCPP() const { return false; }
229
230 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000231 const InputInfo &Output,
232 const InputInfoList &Inputs,
233 const ArgList &TCArgs,
Daniel Dunbarbe220842009-03-20 16:06:39 +0000234 const char *LinkingOutput) const;
235 };
236
Duncan Sandsaf260b92010-05-11 20:16:05 +0000237 class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool {
Daniel Dunbarccbc4522010-09-09 21:51:05 +0000238 void AddLinkArgs(Compilation &C, const ArgList &Args,
239 ArgStringList &CmdArgs) const;
Daniel Dunbarc1964212009-03-26 16:23:12 +0000240
Daniel Dunbarc1964212009-03-26 16:23:12 +0000241 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000242 Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {}
Daniel Dunbarc1964212009-03-26 16:23:12 +0000243
Daniel Dunbarc1964212009-03-26 16:23:12 +0000244 virtual bool hasIntegratedCPP() const { return false; }
245
246 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000247 const InputInfo &Output,
248 const InputInfoList &Inputs,
249 const ArgList &TCArgs,
Daniel Dunbarc1964212009-03-26 16:23:12 +0000250 const char *LinkingOutput) const;
251 };
252
Duncan Sandsaf260b92010-05-11 20:16:05 +0000253 class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool {
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000254 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000255 Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {}
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000256
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000257 virtual bool hasIntegratedCPP() const { return false; }
258
259 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000260 const InputInfo &Output,
261 const InputInfoList &Inputs,
262 const ArgList &TCArgs,
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000263 const char *LinkingOutput) const;
264 };
Daniel Dunbar88299622010-06-04 18:28:36 +0000265
266 class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool {
267 public:
268 Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil",
269 "dsymutil", TC) {}
270
Daniel Dunbar88299622010-06-04 18:28:36 +0000271 virtual bool hasIntegratedCPP() const { return false; }
272
273 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Daniel Dunbar88299622010-06-04 18:28:36 +0000274 const InputInfo &Output,
275 const InputInfoList &Inputs,
276 const ArgList &TCArgs,
277 const char *LinkingOutput) const;
278 };
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000279}
280
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000281 /// openbsd -- Directly call GNU Binutils assembler and linker
282namespace openbsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000283 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000284 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000285 Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler",
286 TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000287
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000288 virtual bool hasIntegratedCPP() const { return false; }
289
290 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000291 const InputInfo &Output,
292 const InputInfoList &Inputs,
293 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000294 const char *LinkingOutput) const;
295 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000296 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000297 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000298 Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000299
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000300 virtual bool hasIntegratedCPP() const { return false; }
301
302 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000303 const InputInfo &Output,
304 const InputInfoList &Inputs,
305 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000306 const char *LinkingOutput) const;
307 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000308} // end namespace openbsd
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000309
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000310 /// freebsd -- Directly call GNU Binutils assembler and linker
311namespace freebsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000312 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000313 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000314 Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler",
315 TC) {}
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000316
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000317 virtual bool hasIntegratedCPP() const { return false; }
318
319 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000320 const InputInfo &Output,
321 const InputInfoList &Inputs,
322 const ArgList &TCArgs,
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000323 const char *LinkingOutput) const;
324 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000325 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000326 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000327 Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {}
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000328
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000329 virtual bool hasIntegratedCPP() const { return false; }
330
331 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000332 const InputInfo &Output,
333 const InputInfoList &Inputs,
334 const ArgList &TCArgs,
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000335 const char *LinkingOutput) const;
336 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000337} // end namespace freebsd
338
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000339 /// netbsd -- Directly call GNU Binutils assembler and linker
340namespace netbsd {
341 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000342 private:
343 const llvm::Triple ToolTriple;
344
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000345 public:
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000346 Assemble(const ToolChain &TC, const llvm::Triple &ToolTriple)
347 : Tool("netbsd::Assemble", "assembler", TC), ToolTriple(ToolTriple) {}
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000348
349 virtual bool hasIntegratedCPP() const { return false; }
350
351 virtual void ConstructJob(Compilation &C, const JobAction &JA,
352 const InputInfo &Output,
353 const InputInfoList &Inputs,
354 const ArgList &TCArgs,
355 const char *LinkingOutput) const;
356 };
357 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000358 private:
359 const llvm::Triple ToolTriple;
360
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000361 public:
Joerg Sonnenberger637603a2011-05-16 13:35:02 +0000362 Link(const ToolChain &TC, const llvm::Triple &ToolTriple)
363 : Tool("netbsd::Ling", "linker", TC), ToolTriple(ToolTriple) {}
Benjamin Kramer24f1d3e2011-02-02 18:59:27 +0000364
365 virtual bool hasIntegratedCPP() const { return false; }
366
367 virtual void ConstructJob(Compilation &C, const JobAction &JA,
368 const InputInfo &Output,
369 const InputInfoList &Inputs,
370 const ArgList &TCArgs,
371 const char *LinkingOutput) const;
372 };
373} // end namespace netbsd
374
Rafael Espindola92b00932010-08-10 00:25:48 +0000375 /// linux -- Directly call GNU Binutils assembler and linker
376namespace linuxtools {
377 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
378 public:
379 Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler",
380 TC) {}
381
382 virtual bool hasIntegratedCPP() const { return false; }
383
384 virtual void ConstructJob(Compilation &C, const JobAction &JA,
385 const InputInfo &Output,
386 const InputInfoList &Inputs,
387 const ArgList &TCArgs,
388 const char *LinkingOutput) const;
389 };
Rafael Espindolac8f008f2010-11-07 20:14:31 +0000390 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
391 public:
392 Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {}
393
394 virtual bool hasIntegratedCPP() const { return false; }
395
396 virtual void ConstructJob(Compilation &C, const JobAction &JA,
397 const InputInfo &Output,
398 const InputInfoList &Inputs,
399 const ArgList &TCArgs,
400 const char *LinkingOutput) const;
401 };
Rafael Espindola92b00932010-08-10 00:25:48 +0000402}
Chris Lattner3e2ee142010-07-07 16:01:42 +0000403 /// minix -- Directly call GNU Binutils assembler and linker
404namespace minix {
405 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
406 public:
407 Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler",
408 TC) {}
409
Chris Lattner3e2ee142010-07-07 16:01:42 +0000410 virtual bool hasIntegratedCPP() const { return false; }
411
412 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000413 const InputInfo &Output,
414 const InputInfoList &Inputs,
415 const ArgList &TCArgs,
416 const char *LinkingOutput) const;
417 };
418 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
419 public:
420 Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {}
421
Chris Lattner3e2ee142010-07-07 16:01:42 +0000422 virtual bool hasIntegratedCPP() const { return false; }
423
424 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000425 const InputInfo &Output,
426 const InputInfoList &Inputs,
427 const ArgList &TCArgs,
428 const char *LinkingOutput) const;
429 };
430} // end namespace minix
431
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000432 /// auroraux -- Directly call GNU Binutils assembler and linker
433namespace auroraux {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000434 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000435 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000436 Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler",
437 TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000438
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000439 virtual bool hasIntegratedCPP() const { return false; }
440
441 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000442 const InputInfo &Output,
443 const InputInfoList &Inputs,
444 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000445 const char *LinkingOutput) const;
446 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000447 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000448 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000449 Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000450
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000451 virtual bool hasIntegratedCPP() const { return false; }
452
453 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000454 const InputInfo &Output,
455 const InputInfoList &Inputs,
456 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000457 const char *LinkingOutput) const;
458 };
459} // end namespace auroraux
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000460
Daniel Dunbarcc912342009-05-02 18:28:39 +0000461 /// dragonfly -- Directly call GNU Binutils assembler and linker
462namespace dragonfly {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000463 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000464 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000465 Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler",
466 TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000467
Daniel Dunbarcc912342009-05-02 18:28:39 +0000468 virtual bool hasIntegratedCPP() const { return false; }
469
470 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000471 const InputInfo &Output,
472 const InputInfoList &Inputs,
473 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000474 const char *LinkingOutput) const;
475 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000476 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000477 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000478 Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000479
Daniel Dunbarcc912342009-05-02 18:28:39 +0000480 virtual bool hasIntegratedCPP() const { return false; }
481
482 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000483 const InputInfo &Output,
484 const InputInfoList &Inputs,
485 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000486 const char *LinkingOutput) const;
487 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000488} // end namespace dragonfly
Daniel Dunbarcc912342009-05-02 18:28:39 +0000489
Michael J. Spencerb186bc32010-08-21 21:55:07 +0000490 /// Visual studio tools.
491namespace visualstudio {
492 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
493 public:
494 Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {}
495
496 virtual bool hasIntegratedCPP() const { return false; }
497
498 virtual void ConstructJob(Compilation &C, const JobAction &JA,
499 const InputInfo &Output,
500 const InputInfoList &Inputs,
501 const ArgList &TCArgs,
502 const char *LinkingOutput) const;
503 };
504} // end namespace visualstudio
505
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000506} // end namespace toolchains
507} // end namespace driver
508} // end namespace clang
509
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000510#endif // CLANG_LIB_DRIVER_TOOLS_H_