blob: edfb2df38e17e6a3358ee959fccf06cd3b085c40 [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
17#include "llvm/Support/Compiler.h"
18
19namespace clang {
20namespace driver {
Douglas Gregor111af7d2009-04-18 00:34:01 +000021 class Driver;
22
Daniel Dunbarc1964212009-03-26 16:23:12 +000023namespace toolchains {
Daniel Dunbarf0a5b9b2009-09-04 18:34:51 +000024 class Darwin;
Daniel Dunbarc1964212009-03-26 16:23:12 +000025}
26
Daniel Dunbar15abb2e2009-03-17 22:18:43 +000027namespace tools {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000028
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000029 /// \brief Clang compiler tool.
Duncan Sandsaf260b92010-05-11 20:16:05 +000030 class LLVM_LIBRARY_VISIBILITY Clang : public Tool {
Douglas Gregor111af7d2009-04-18 00:34:01 +000031 void AddPreprocessingOptions(const Driver &D,
32 const ArgList &Args,
Daniel Dunbard067f7f2009-04-08 23:54:23 +000033 ArgStringList &CmdArgs,
34 const InputInfo &Output,
35 const InputInfoList &Inputs) const;
36
Daniel Dunbar0f5c5422009-09-10 04:57:17 +000037 void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Eric Christopher0b26a612010-03-02 02:41:08 +000038 void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbar3b3191f2009-09-09 22:33:08 +000039 void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
40
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000041 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000042 Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000043
Daniel Dunbar3d45e172010-04-06 17:07:49 +000044 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbarc4343942010-02-03 03:07:56 +000045 virtual bool hasIntegratedAssembler() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000046 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +000047
48 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +000049 const InputInfo &Output,
50 const InputInfoList &Inputs,
51 const ArgList &TCArgs,
Daniel Dunbar1a093d22009-03-18 06:00:36 +000052 const char *LinkingOutput) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000053 };
54
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000055 /// \brief Clang integrated assembler tool.
56 class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool {
57 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000058 ClangAs(const ToolChain &TC) : Tool("clang::as",
59 "clang integrated assembler", TC) {}
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000060
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000061 virtual bool hasGoodDiagnostics() const { return true; }
62 virtual bool hasIntegratedAssembler() const { return false; }
63 virtual bool hasIntegratedCPP() const { return false; }
64
65 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Daniel Dunbar4f5e79c2010-05-20 21:30:13 +000066 const InputInfo &Output,
67 const InputInfoList &Inputs,
68 const ArgList &TCArgs,
69 const char *LinkingOutput) const;
70 };
71
Daniel Dunbar82116f82009-03-17 22:45:24 +000072 /// gcc - Generic GCC tool implementations.
73namespace gcc {
Duncan Sandsaf260b92010-05-11 20:16:05 +000074 class LLVM_LIBRARY_VISIBILITY Common : public Tool {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000075 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000076 Common(const char *Name, const char *ShortName,
77 const ToolChain &TC) : Tool(Name, ShortName, TC) {}
Daniel Dunbara3246a02009-03-18 08:07:30 +000078
79 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +000080 const InputInfo &Output,
81 const InputInfoList &Inputs,
82 const ArgList &TCArgs,
Daniel Dunbara3246a02009-03-18 08:07:30 +000083 const char *LinkingOutput) const;
84
85 /// RenderExtraToolArgs - Render any arguments necessary to force
86 /// the particular tool mode.
Daniel Dunbar4e295052010-01-25 22:35:08 +000087 virtual void RenderExtraToolArgs(const JobAction &JA,
88 ArgStringList &CmdArgs) const = 0;
Daniel Dunbara3246a02009-03-18 08:07:30 +000089 };
90
Mike Stump11289f42009-09-09 15:08:12 +000091
Duncan Sandsaf260b92010-05-11 20:16:05 +000092 class LLVM_LIBRARY_VISIBILITY Preprocess : public Common {
Daniel Dunbara3246a02009-03-18 08:07:30 +000093 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +000094 Preprocess(const ToolChain &TC) : Common("gcc::Preprocess",
95 "gcc preprocessor", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000096
Daniel Dunbar3d45e172010-04-06 17:07:49 +000097 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +000098 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +000099
Daniel Dunbar4e295052010-01-25 22:35:08 +0000100 virtual void RenderExtraToolArgs(const JobAction &JA,
101 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000102 };
103
Duncan Sandsaf260b92010-05-11 20:16:05 +0000104 class LLVM_LIBRARY_VISIBILITY Precompile : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000105 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000106 Precompile(const ToolChain &TC) : Common("gcc::Precompile",
107 "gcc precompile", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000108
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000109 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000110 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000111
Daniel Dunbar4e295052010-01-25 22:35:08 +0000112 virtual void RenderExtraToolArgs(const JobAction &JA,
113 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000114 };
115
Duncan Sandsaf260b92010-05-11 20:16:05 +0000116 class LLVM_LIBRARY_VISIBILITY Compile : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000117 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000118 Compile(const ToolChain &TC) : Common("gcc::Compile",
119 "gcc frontend", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000120
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000121 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000122 virtual bool hasIntegratedCPP() const { return true; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000123
Daniel Dunbar4e295052010-01-25 22:35:08 +0000124 virtual void RenderExtraToolArgs(const JobAction &JA,
125 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000126 };
127
Duncan Sandsaf260b92010-05-11 20:16:05 +0000128 class LLVM_LIBRARY_VISIBILITY Assemble : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000129 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000130 Assemble(const ToolChain &TC) : Common("gcc::Assemble",
131 "assembler (via gcc)", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000132
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000133 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000134
Daniel Dunbar4e295052010-01-25 22:35:08 +0000135 virtual void RenderExtraToolArgs(const JobAction &JA,
136 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000137 };
138
Duncan Sandsaf260b92010-05-11 20:16:05 +0000139 class LLVM_LIBRARY_VISIBILITY Link : public Common {
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000140 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000141 Link(const ToolChain &TC) : Common("gcc::Link",
142 "linker (via gcc)", TC) {}
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000143
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000144 virtual bool hasIntegratedCPP() const { return false; }
Daniel Dunbar1a093d22009-03-18 06:00:36 +0000145
Daniel Dunbar4e295052010-01-25 22:35:08 +0000146 virtual void RenderExtraToolArgs(const JobAction &JA,
147 ArgStringList &CmdArgs) const;
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000148 };
Daniel Dunbar82116f82009-03-17 22:45:24 +0000149} // end namespace gcc
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000150
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000151namespace darwin {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000152 class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool {
Daniel Dunbare9ded432009-09-09 18:36:20 +0000153 protected:
154 void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare9ded432009-09-09 18:36:20 +0000155
156 const toolchains::Darwin &getDarwinToolChain() const {
157 return reinterpret_cast<const toolchains::Darwin&>(getToolChain());
158 }
159
160 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000161 DarwinTool(const char *Name, const char *ShortName,
162 const ToolChain &TC) : Tool(Name, ShortName, TC) {}
Daniel Dunbare9ded432009-09-09 18:36:20 +0000163 };
164
Duncan Sandsaf260b92010-05-11 20:16:05 +0000165 class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool {
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000166 public:
Mike Stump11289f42009-09-09 15:08:12 +0000167 static const char *getBaseInputName(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000168 const InputInfoList &Input);
Mike Stump11289f42009-09-09 15:08:12 +0000169 static const char *getBaseInputStem(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000170 const InputInfoList &Input);
Mike Stump11289f42009-09-09 15:08:12 +0000171 static const char *getDependencyFileName(const ArgList &Args,
Daniel Dunbar52e96cc2009-03-30 00:34:04 +0000172 const InputInfoList &Inputs);
173
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000174 protected:
175 const char *getCC1Name(types::ID Type) const;
176
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000177 void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000178 void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
179 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000180 const ArgStringList &OutputArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000181 void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs,
182 const InputInfoList &Inputs,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000183 const ArgStringList &OutputArgs) const;
Mike Stump11289f42009-09-09 15:08:12 +0000184 void AddCPPUniqueOptionsArgs(const ArgList &Args,
Daniel Dunbarafec1f52009-03-29 18:40:18 +0000185 ArgStringList &CmdArgs,
186 const InputInfoList &Inputs) const;
187 void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000188
189 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000190 CC1(const char *Name, const char *ShortName,
191 const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000192
Daniel Dunbar3d45e172010-04-06 17:07:49 +0000193 virtual bool hasGoodDiagnostics() const { return true; }
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000194 virtual bool hasIntegratedCPP() const { return true; }
195 };
196
Duncan Sandsaf260b92010-05-11 20:16:05 +0000197 class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000198 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000199 Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess",
200 "gcc preprocessor", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000201
202 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000203 const InputInfo &Output,
204 const InputInfoList &Inputs,
205 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000206 const char *LinkingOutput) const;
207 };
208
Duncan Sandsaf260b92010-05-11 20:16:05 +0000209 class LLVM_LIBRARY_VISIBILITY Compile : public CC1 {
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000210 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000211 Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {}
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000212
213 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000214 const InputInfo &Output,
215 const InputInfoList &Inputs,
216 const ArgList &TCArgs,
Daniel Dunbare6adeee2009-03-29 17:08:39 +0000217 const char *LinkingOutput) const;
218 };
219
Duncan Sandsaf260b92010-05-11 20:16:05 +0000220 class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool {
Daniel Dunbarbe220842009-03-20 16:06:39 +0000221 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000222 Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble",
223 "assembler", TC) {}
Daniel Dunbarbe220842009-03-20 16:06:39 +0000224
Daniel Dunbarbe220842009-03-20 16:06:39 +0000225 virtual bool hasIntegratedCPP() const { return false; }
226
227 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000228 const InputInfo &Output,
229 const InputInfoList &Inputs,
230 const ArgList &TCArgs,
Daniel Dunbarbe220842009-03-20 16:06:39 +0000231 const char *LinkingOutput) const;
232 };
233
Duncan Sandsaf260b92010-05-11 20:16:05 +0000234 class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool {
Daniel Dunbarccbc4522010-09-09 21:51:05 +0000235 void AddLinkArgs(Compilation &C, const ArgList &Args,
236 ArgStringList &CmdArgs) const;
Daniel Dunbarc1964212009-03-26 16:23:12 +0000237
Daniel Dunbarc1964212009-03-26 16:23:12 +0000238 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000239 Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {}
Daniel Dunbarc1964212009-03-26 16:23:12 +0000240
Daniel Dunbarc1964212009-03-26 16:23:12 +0000241 virtual bool hasIntegratedCPP() const { return false; }
242
243 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000244 const InputInfo &Output,
245 const InputInfoList &Inputs,
246 const ArgList &TCArgs,
Daniel Dunbarc1964212009-03-26 16:23:12 +0000247 const char *LinkingOutput) const;
248 };
249
Duncan Sandsaf260b92010-05-11 20:16:05 +0000250 class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool {
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000251 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000252 Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {}
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000253
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000254 virtual bool hasIntegratedCPP() const { return false; }
255
256 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000257 const InputInfo &Output,
258 const InputInfoList &Inputs,
259 const ArgList &TCArgs,
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000260 const char *LinkingOutput) const;
261 };
Daniel Dunbar88299622010-06-04 18:28:36 +0000262
263 class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool {
264 public:
265 Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil",
266 "dsymutil", TC) {}
267
Daniel Dunbar88299622010-06-04 18:28:36 +0000268 virtual bool hasIntegratedCPP() const { return false; }
269
270 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Daniel Dunbar88299622010-06-04 18:28:36 +0000271 const InputInfo &Output,
272 const InputInfoList &Inputs,
273 const ArgList &TCArgs,
274 const char *LinkingOutput) const;
275 };
Daniel Dunbar64ed5e32009-03-20 00:52:38 +0000276}
277
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000278 /// openbsd -- Directly call GNU Binutils assembler and linker
279namespace openbsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000280 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000281 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000282 Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler",
283 TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000284
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000285 virtual bool hasIntegratedCPP() const { return false; }
286
287 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000288 const InputInfo &Output,
289 const InputInfoList &Inputs,
290 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000291 const char *LinkingOutput) const;
292 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000293 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000294 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000295 Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {}
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000296
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000297 virtual bool hasIntegratedCPP() const { return false; }
298
299 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000300 const InputInfo &Output,
301 const InputInfoList &Inputs,
302 const ArgList &TCArgs,
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000303 const char *LinkingOutput) const;
304 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000305} // end namespace openbsd
Daniel Dunbar10de9e62009-06-29 20:52:51 +0000306
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000307 /// freebsd -- Directly call GNU Binutils assembler and linker
308namespace freebsd {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000309 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000310 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000311 Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler",
312 TC) {}
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000313
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000314 virtual bool hasIntegratedCPP() const { return false; }
315
316 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000317 const InputInfo &Output,
318 const InputInfoList &Inputs,
319 const ArgList &TCArgs,
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000320 const char *LinkingOutput) const;
321 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000322 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000323 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000324 Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {}
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000325
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000326 virtual bool hasIntegratedCPP() const { return false; }
327
328 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000329 const InputInfo &Output,
330 const InputInfoList &Inputs,
331 const ArgList &TCArgs,
Daniel Dunbard854c8d2009-04-01 19:36:32 +0000332 const char *LinkingOutput) const;
333 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000334} // end namespace freebsd
335
Rafael Espindola92b00932010-08-10 00:25:48 +0000336 /// linux -- Directly call GNU Binutils assembler and linker
337namespace linuxtools {
338 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
339 public:
340 Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler",
341 TC) {}
342
343 virtual bool hasIntegratedCPP() const { return false; }
344
345 virtual void ConstructJob(Compilation &C, const JobAction &JA,
346 const InputInfo &Output,
347 const InputInfoList &Inputs,
348 const ArgList &TCArgs,
349 const char *LinkingOutput) const;
350 };
Rafael Espindolac8f008f2010-11-07 20:14:31 +0000351 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
352 public:
353 Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {}
354
355 virtual bool hasIntegratedCPP() const { return false; }
356
357 virtual void ConstructJob(Compilation &C, const JobAction &JA,
358 const InputInfo &Output,
359 const InputInfoList &Inputs,
360 const ArgList &TCArgs,
361 const char *LinkingOutput) const;
362 };
Rafael Espindola92b00932010-08-10 00:25:48 +0000363}
Chris Lattner3e2ee142010-07-07 16:01:42 +0000364 /// minix -- Directly call GNU Binutils assembler and linker
365namespace minix {
366 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
367 public:
368 Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler",
369 TC) {}
370
Chris Lattner3e2ee142010-07-07 16:01:42 +0000371 virtual bool hasIntegratedCPP() const { return false; }
372
373 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000374 const InputInfo &Output,
375 const InputInfoList &Inputs,
376 const ArgList &TCArgs,
377 const char *LinkingOutput) const;
378 };
379 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
380 public:
381 Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {}
382
Chris Lattner3e2ee142010-07-07 16:01:42 +0000383 virtual bool hasIntegratedCPP() const { return false; }
384
385 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Chris Lattner3e2ee142010-07-07 16:01:42 +0000386 const InputInfo &Output,
387 const InputInfoList &Inputs,
388 const ArgList &TCArgs,
389 const char *LinkingOutput) const;
390 };
391} // end namespace minix
392
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000393 /// auroraux -- Directly call GNU Binutils assembler and linker
394namespace auroraux {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000395 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000396 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000397 Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler",
398 TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000399
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000400 virtual bool hasIntegratedCPP() const { return false; }
401
402 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000403 const InputInfo &Output,
404 const InputInfoList &Inputs,
405 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000406 const char *LinkingOutput) const;
407 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000408 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000409 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000410 Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {}
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000411
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000412 virtual bool hasIntegratedCPP() const { return false; }
413
414 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000415 const InputInfo &Output,
416 const InputInfoList &Inputs,
417 const ArgList &TCArgs,
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000418 const char *LinkingOutput) const;
419 };
420} // end namespace auroraux
Daniel Dunbar8eb473c2009-03-31 17:45:15 +0000421
Daniel Dunbarcc912342009-05-02 18:28:39 +0000422 /// dragonfly -- Directly call GNU Binutils assembler and linker
423namespace dragonfly {
Duncan Sandsaf260b92010-05-11 20:16:05 +0000424 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000425 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000426 Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler",
427 TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000428
Daniel Dunbarcc912342009-05-02 18:28:39 +0000429 virtual bool hasIntegratedCPP() const { return false; }
430
431 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000432 const InputInfo &Output,
433 const InputInfoList &Inputs,
434 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000435 const char *LinkingOutput) const;
436 };
Duncan Sandsaf260b92010-05-11 20:16:05 +0000437 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
Daniel Dunbarcc912342009-05-02 18:28:39 +0000438 public:
Daniel Dunbar1cb532c2010-05-22 00:37:18 +0000439 Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {}
Daniel Dunbarcc912342009-05-02 18:28:39 +0000440
Daniel Dunbarcc912342009-05-02 18:28:39 +0000441 virtual bool hasIntegratedCPP() const { return false; }
442
443 virtual void ConstructJob(Compilation &C, const JobAction &JA,
Mike Stump11289f42009-09-09 15:08:12 +0000444 const InputInfo &Output,
445 const InputInfoList &Inputs,
446 const ArgList &TCArgs,
Daniel Dunbarcc912342009-05-02 18:28:39 +0000447 const char *LinkingOutput) const;
448 };
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000449} // end namespace dragonfly
Daniel Dunbarcc912342009-05-02 18:28:39 +0000450
Michael J. Spencerb186bc32010-08-21 21:55:07 +0000451 /// Visual studio tools.
452namespace visualstudio {
453 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
454 public:
455 Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {}
456
457 virtual bool hasIntegratedCPP() const { return false; }
458
459 virtual void ConstructJob(Compilation &C, const JobAction &JA,
460 const InputInfo &Output,
461 const InputInfoList &Inputs,
462 const ArgList &TCArgs,
463 const char *LinkingOutput) const;
464 };
465} // end namespace visualstudio
466
Daniel Dunbar5903d8c2009-03-17 22:07:58 +0000467} // end namespace toolchains
468} // end namespace driver
469} // end namespace clang
470
Edward O'Callaghan856e4ff2009-08-22 01:06:46 +0000471#endif // CLANG_LIB_DRIVER_TOOLS_H_