Tools.h revision 66b8a6671bb5df540dd7200a5286f7ed7a72c1cc
15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//===--- Tools.h - Tool Implementations -------------------------*- C++ -*-===//
25f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//
35f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//                     The LLVM Compiler Infrastructure
45f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//
55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// This file is distributed under the University of Illinois Open Source
65f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// License. See LICENSE.TXT for details.
75f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//
81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci//===----------------------------------------------------------------------===//
95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#ifndef CLANG_LIB_DRIVER_TOOLS_H_
115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#define CLANG_LIB_DRIVER_TOOLS_H_
125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "clang/Driver/Tool.h"
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "clang/Driver/Types.h"
155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "clang/Driver/Util.h"
165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "llvm/ADT/Triple.h"
185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "llvm/Support/Compiler.h"
195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace clang {
215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  class ObjCRuntime;
225f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace driver {
245f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  class Driver;
255f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace toolchains {
271320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  class Darwin;
285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)}
295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace tools {
311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  /// \brief Clang compiler tool.
335f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  class LLVM_LIBRARY_VISIBILITY Clang : public Tool {
345f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    static const char *getBaseInputName(const ArgList &Args,
355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                                        const InputInfoList &Inputs);
361320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    static const char *getBaseInputStem(const ArgList &Args,
371320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                        const InputInfoList &Inputs);
385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    static const char *getDependencyFileName(const ArgList &Args,
395f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                                             const InputInfoList &Inputs);
405f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
415f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddPreprocessingOptions(Compilation &C,
421320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                 const Driver &D,
431320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                 const ArgList &Args,
445f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                                 ArgStringList &CmdArgs,
455f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                                 const InputInfo &Output,
461320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                 const InputInfoList &Inputs) const;
475f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
485f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs,
495f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                          bool KernelOrKext) const;
501320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
511320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    void AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
525f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
535f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
545f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddHexagonTargetArgs (const ArgList &Args, ArgStringList &CmdArgs) const;
551320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
561320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile };
575f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
585f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    ObjCRuntime AddObjCRuntimeArgs(const ArgList &args, ArgStringList &cmdArgs,
591320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                   RewriteKind rewrite) const;
601320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
611320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  public:
625f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {}
635f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
641320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual bool hasGoodDiagnostics() const { return true; }
651320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual bool hasIntegratedAssembler() const { return true; }
661320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual bool hasIntegratedCPP() const { return true; }
676e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
681320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual void ConstructJob(Compilation &C, const JobAction &JA,
691320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                              const InputInfo &Output,
701320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                              const InputInfoList &Inputs,
715f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                              const ArgList &TCArgs,
725f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                              const char *LinkingOutput) const;
731320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  };
741320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
755f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  /// \brief Clang integrated assembler tool.
765f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool {
775f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
781320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  public:
791320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    ClangAs(const ToolChain &TC) : Tool("clang::as",
801320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                                        "clang integrated assembler", TC) {}
811320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
825f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    virtual bool hasGoodDiagnostics() const { return true; }
831320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual bool hasIntegratedAssembler() const { return false; }
841320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    virtual bool hasIntegratedCPP() const { return false; }
855f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
865f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    virtual void ConstructJob(Compilation &C, const JobAction &JA,
871320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                              const InputInfo &Output,
881320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci                              const InputInfoList &Inputs,
895f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                              const ArgList &TCArgs,
905f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)                              const char *LinkingOutput) const;
915f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  };
925f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
93  /// gcc - Generic GCC tool implementations.
94namespace gcc {
95  class LLVM_LIBRARY_VISIBILITY Common : public Tool {
96  public:
97    Common(const char *Name, const char *ShortName,
98           const ToolChain &TC) : Tool(Name, ShortName, TC) {}
99
100    virtual void ConstructJob(Compilation &C, const JobAction &JA,
101                              const InputInfo &Output,
102                              const InputInfoList &Inputs,
103                              const ArgList &TCArgs,
104                              const char *LinkingOutput) const;
105
106    /// RenderExtraToolArgs - Render any arguments necessary to force
107    /// the particular tool mode.
108    virtual void RenderExtraToolArgs(const JobAction &JA,
109                                     ArgStringList &CmdArgs) const = 0;
110  };
111
112
113  class LLVM_LIBRARY_VISIBILITY Preprocess : public Common {
114  public:
115    Preprocess(const ToolChain &TC) : Common("gcc::Preprocess",
116                                             "gcc preprocessor", TC) {}
117
118    virtual bool hasGoodDiagnostics() const { return true; }
119    virtual bool hasIntegratedCPP() const { return false; }
120
121    virtual void RenderExtraToolArgs(const JobAction &JA,
122                                     ArgStringList &CmdArgs) const;
123  };
124
125  class LLVM_LIBRARY_VISIBILITY Precompile : public Common  {
126  public:
127    Precompile(const ToolChain &TC) : Common("gcc::Precompile",
128                                             "gcc precompile", TC) {}
129
130    virtual bool hasGoodDiagnostics() const { return true; }
131    virtual bool hasIntegratedCPP() const { return true; }
132
133    virtual void RenderExtraToolArgs(const JobAction &JA,
134                                     ArgStringList &CmdArgs) const;
135  };
136
137  class LLVM_LIBRARY_VISIBILITY Compile : public Common  {
138  public:
139    Compile(const ToolChain &TC) : Common("gcc::Compile",
140                                          "gcc frontend", TC) {}
141
142    virtual bool hasGoodDiagnostics() const { return true; }
143    virtual bool hasIntegratedCPP() const { return true; }
144
145    virtual void RenderExtraToolArgs(const JobAction &JA,
146                                     ArgStringList &CmdArgs) const;
147  };
148
149  class LLVM_LIBRARY_VISIBILITY Assemble : public Common  {
150  public:
151    Assemble(const ToolChain &TC) : Common("gcc::Assemble",
152                                           "assembler (via gcc)", TC) {}
153
154    virtual bool hasIntegratedCPP() const { return false; }
155
156    virtual void RenderExtraToolArgs(const JobAction &JA,
157                                     ArgStringList &CmdArgs) const;
158  };
159
160  class LLVM_LIBRARY_VISIBILITY Link : public Common  {
161  public:
162    Link(const ToolChain &TC) : Common("gcc::Link",
163                                       "linker (via gcc)", TC) {}
164
165    virtual bool hasIntegratedCPP() const { return false; }
166    virtual bool isLinkJob() const { return true; }
167
168    virtual void RenderExtraToolArgs(const JobAction &JA,
169                                     ArgStringList &CmdArgs) const;
170  };
171} // end namespace gcc
172
173namespace hexagon {
174  // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile.
175  // We simply use "clang -cc1" for those actions.
176  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
177  public:
178    Assemble(const ToolChain &TC) : Tool("hexagon::Assemble",
179      "hexagon-as", TC) {}
180
181    virtual bool hasIntegratedCPP() const { return false; }
182
183    virtual void RenderExtraToolArgs(const JobAction &JA,
184                                     ArgStringList &CmdArgs) const;
185    virtual void ConstructJob(Compilation &C, const JobAction &JA,
186                              const InputInfo &Output,
187                              const InputInfoList &Inputs,
188                              const ArgList &TCArgs,
189                              const char *LinkingOutput) const;
190  };
191
192  class LLVM_LIBRARY_VISIBILITY Link : public Tool {
193  public:
194    Link(const ToolChain &TC) : Tool("hexagon::Link",
195      "hexagon-ld", TC) {}
196
197    virtual bool hasIntegratedCPP() const { return false; }
198    virtual bool isLinkJob() const { return true; }
199
200    virtual void RenderExtraToolArgs(const JobAction &JA,
201                                     ArgStringList &CmdArgs) const;
202    virtual void ConstructJob(Compilation &C, const JobAction &JA,
203                              const InputInfo &Output,
204                              const InputInfoList &Inputs,
205                              const ArgList &TCArgs,
206                              const char *LinkingOutput) const;
207  };
208} // end namespace hexagon.
209
210
211namespace darwin {
212  llvm::Triple::ArchType getArchTypeForDarwinArchName(StringRef Str);
213
214  class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool {
215    virtual void anchor();
216  protected:
217    void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const;
218
219    const toolchains::Darwin &getDarwinToolChain() const {
220      return reinterpret_cast<const toolchains::Darwin&>(getToolChain());
221    }
222
223  public:
224    DarwinTool(const char *Name, const char *ShortName,
225               const ToolChain &TC) : Tool(Name, ShortName, TC) {}
226  };
227
228  class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool  {
229  public:
230    Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble",
231                                               "assembler", TC) {}
232
233    virtual bool hasIntegratedCPP() const { return false; }
234
235    virtual void ConstructJob(Compilation &C, const JobAction &JA,
236                              const InputInfo &Output,
237                              const InputInfoList &Inputs,
238                              const ArgList &TCArgs,
239                              const char *LinkingOutput) const;
240  };
241
242  class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool  {
243    bool NeedsTempPath(const InputInfoList &Inputs) const;
244    void AddLinkArgs(Compilation &C, const ArgList &Args,
245                     ArgStringList &CmdArgs, const InputInfoList &Inputs) const;
246
247  public:
248    Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {}
249
250    virtual bool hasIntegratedCPP() const { return false; }
251    virtual bool isLinkJob() const { return true; }
252
253    virtual void ConstructJob(Compilation &C, const JobAction &JA,
254                              const InputInfo &Output,
255                              const InputInfoList &Inputs,
256                              const ArgList &TCArgs,
257                              const char *LinkingOutput) const;
258  };
259
260  class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool  {
261  public:
262    Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {}
263
264    virtual bool hasIntegratedCPP() const { return false; }
265
266    virtual void ConstructJob(Compilation &C, const JobAction &JA,
267                              const InputInfo &Output,
268                              const InputInfoList &Inputs,
269                              const ArgList &TCArgs,
270                              const char *LinkingOutput) const;
271  };
272
273  class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool  {
274  public:
275    Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil",
276                                               "dsymutil", TC) {}
277
278    virtual bool hasIntegratedCPP() const { return false; }
279
280    virtual void ConstructJob(Compilation &C, const JobAction &JA,
281                              const InputInfo &Output,
282                              const InputInfoList &Inputs,
283                              const ArgList &TCArgs,
284                              const char *LinkingOutput) const;
285  };
286
287  class LLVM_LIBRARY_VISIBILITY VerifyDebug : public DarwinTool  {
288  public:
289    VerifyDebug(const ToolChain &TC) : DarwinTool("darwin::VerifyDebug",
290						  "dwarfdump", TC) {}
291
292    virtual bool hasIntegratedCPP() const { return false; }
293
294    virtual void ConstructJob(Compilation &C, const JobAction &JA,
295			      const InputInfo &Output,
296			      const InputInfoList &Inputs,
297			      const ArgList &TCArgs,
298			      const char *LinkingOutput) const;
299  };
300
301}
302
303  /// openbsd -- Directly call GNU Binutils assembler and linker
304namespace openbsd {
305  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
306  public:
307    Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler",
308                                         TC) {}
309
310    virtual bool hasIntegratedCPP() const { return false; }
311
312    virtual void ConstructJob(Compilation &C, const JobAction &JA,
313                              const InputInfo &Output,
314                              const InputInfoList &Inputs,
315                              const ArgList &TCArgs,
316                              const char *LinkingOutput) const;
317  };
318  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
319  public:
320    Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {}
321
322    virtual bool hasIntegratedCPP() const { return false; }
323    virtual bool isLinkJob() const { return true; }
324
325    virtual void ConstructJob(Compilation &C, const JobAction &JA,
326                              const InputInfo &Output,
327                              const InputInfoList &Inputs,
328                              const ArgList &TCArgs,
329                              const char *LinkingOutput) const;
330  };
331} // end namespace openbsd
332
333  /// bitrig -- Directly call GNU Binutils assembler and linker
334namespace bitrig {
335  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
336  public:
337    Assemble(const ToolChain &TC) : Tool("bitrig::Assemble", "assembler",
338                                         TC) {}
339
340    virtual bool hasIntegratedCPP() const { return false; }
341
342    virtual void ConstructJob(Compilation &C, const JobAction &JA,
343                              const InputInfo &Output,
344                              const InputInfoList &Inputs,
345                              const ArgList &TCArgs,
346                              const char *LinkingOutput) const;
347  };
348  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
349  public:
350    Link(const ToolChain &TC) : Tool("bitrig::Link", "linker", TC) {}
351
352    virtual bool hasIntegratedCPP() const { return false; }
353    virtual bool isLinkJob() const { return true; }
354
355    virtual void ConstructJob(Compilation &C, const JobAction &JA,
356                              const InputInfo &Output,
357                              const InputInfoList &Inputs,
358                              const ArgList &TCArgs,
359                              const char *LinkingOutput) const;
360  };
361} // end namespace bitrig
362
363  /// freebsd -- Directly call GNU Binutils assembler and linker
364namespace freebsd {
365  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
366  public:
367    Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler",
368                                         TC) {}
369
370    virtual bool hasIntegratedCPP() const { return false; }
371
372    virtual void ConstructJob(Compilation &C, const JobAction &JA,
373                              const InputInfo &Output,
374                              const InputInfoList &Inputs,
375                              const ArgList &TCArgs,
376                              const char *LinkingOutput) const;
377  };
378  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
379  public:
380    Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {}
381
382    virtual bool hasIntegratedCPP() const { return false; }
383    virtual bool isLinkJob() const { return true; }
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  };
391} // end namespace freebsd
392
393  /// netbsd -- Directly call GNU Binutils assembler and linker
394namespace netbsd {
395  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
396
397  public:
398    Assemble(const ToolChain &TC)
399      : Tool("netbsd::Assemble", "assembler", TC) {}
400
401    virtual bool hasIntegratedCPP() const { return false; }
402
403    virtual void ConstructJob(Compilation &C, const JobAction &JA,
404                              const InputInfo &Output,
405                              const InputInfoList &Inputs,
406                              const ArgList &TCArgs,
407                              const char *LinkingOutput) const;
408  };
409  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
410
411  public:
412    Link(const ToolChain &TC)
413      : Tool("netbsd::Link", "linker", TC) {}
414
415    virtual bool hasIntegratedCPP() const { return false; }
416    virtual bool isLinkJob() const { return true; }
417
418    virtual void ConstructJob(Compilation &C, const JobAction &JA,
419                              const InputInfo &Output,
420                              const InputInfoList &Inputs,
421                              const ArgList &TCArgs,
422                              const char *LinkingOutput) const;
423  };
424} // end namespace netbsd
425
426  /// linux -- Directly call GNU Binutils assembler and linker
427namespace linuxtools {
428  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
429  public:
430    Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler",
431                                         TC) {}
432
433    virtual bool hasIntegratedCPP() const { return false; }
434
435    virtual void ConstructJob(Compilation &C, const JobAction &JA,
436                              const InputInfo &Output,
437                              const InputInfoList &Inputs,
438                              const ArgList &TCArgs,
439                              const char *LinkingOutput) const;
440  };
441  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
442  public:
443    Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {}
444
445    virtual bool hasIntegratedCPP() const { return false; }
446    virtual bool isLinkJob() const { return true; }
447
448    virtual void ConstructJob(Compilation &C, const JobAction &JA,
449                              const InputInfo &Output,
450                              const InputInfoList &Inputs,
451                              const ArgList &TCArgs,
452                              const char *LinkingOutput) const;
453  };
454}
455  /// minix -- Directly call GNU Binutils assembler and linker
456namespace minix {
457  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
458  public:
459    Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler",
460                                         TC) {}
461
462    virtual bool hasIntegratedCPP() const { return false; }
463
464    virtual void ConstructJob(Compilation &C, const JobAction &JA,
465                              const InputInfo &Output,
466                              const InputInfoList &Inputs,
467                              const ArgList &TCArgs,
468                              const char *LinkingOutput) const;
469  };
470  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
471  public:
472    Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {}
473
474    virtual bool hasIntegratedCPP() const { return false; }
475    virtual bool isLinkJob() const { return true; }
476
477    virtual void ConstructJob(Compilation &C, const JobAction &JA,
478                              const InputInfo &Output,
479                              const InputInfoList &Inputs,
480                              const ArgList &TCArgs,
481                              const char *LinkingOutput) const;
482  };
483} // end namespace minix
484
485  /// solaris -- Directly call Solaris assembler and linker
486namespace solaris {
487  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
488  public:
489    Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler",
490                                         TC) {}
491
492    virtual bool hasIntegratedCPP() const { return false; }
493
494    virtual void ConstructJob(Compilation &C, const JobAction &JA,
495                              const InputInfo &Output,
496                              const InputInfoList &Inputs,
497                              const ArgList &TCArgs,
498                              const char *LinkingOutput) const;
499  };
500  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
501  public:
502    Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {}
503
504    virtual bool hasIntegratedCPP() const { return false; }
505    virtual bool isLinkJob() const { return true; }
506
507    virtual void ConstructJob(Compilation &C, const JobAction &JA,
508                              const InputInfo &Output,
509                              const InputInfoList &Inputs,
510                              const ArgList &TCArgs,
511                              const char *LinkingOutput) const;
512  };
513} // end namespace solaris
514
515  /// auroraux -- Directly call GNU Binutils assembler and linker
516namespace auroraux {
517  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
518  public:
519    Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler",
520                                         TC) {}
521
522    virtual bool hasIntegratedCPP() const { return false; }
523
524    virtual void ConstructJob(Compilation &C, const JobAction &JA,
525                              const InputInfo &Output,
526                              const InputInfoList &Inputs,
527                              const ArgList &TCArgs,
528                              const char *LinkingOutput) const;
529  };
530  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
531  public:
532    Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {}
533
534    virtual bool hasIntegratedCPP() const { return false; }
535    virtual bool isLinkJob() const { return true; }
536
537    virtual void ConstructJob(Compilation &C, const JobAction &JA,
538                              const InputInfo &Output,
539                              const InputInfoList &Inputs,
540                              const ArgList &TCArgs,
541                              const char *LinkingOutput) const;
542  };
543} // end namespace auroraux
544
545  /// dragonfly -- Directly call GNU Binutils assembler and linker
546namespace dragonfly {
547  class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
548  public:
549    Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler",
550                                         TC) {}
551
552    virtual bool hasIntegratedCPP() const { return false; }
553
554    virtual void ConstructJob(Compilation &C, const JobAction &JA,
555                              const InputInfo &Output,
556                              const InputInfoList &Inputs,
557                              const ArgList &TCArgs,
558                              const char *LinkingOutput) const;
559  };
560  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
561  public:
562    Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {}
563
564    virtual bool hasIntegratedCPP() const { return false; }
565    virtual bool isLinkJob() const { return true; }
566
567    virtual void ConstructJob(Compilation &C, const JobAction &JA,
568                              const InputInfo &Output,
569                              const InputInfoList &Inputs,
570                              const ArgList &TCArgs,
571                              const char *LinkingOutput) const;
572  };
573} // end namespace dragonfly
574
575  /// Visual studio tools.
576namespace visualstudio {
577  class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
578  public:
579    Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {}
580
581    virtual bool hasIntegratedCPP() const { return false; }
582    virtual bool isLinkJob() const { return true; }
583
584    virtual void ConstructJob(Compilation &C, const JobAction &JA,
585                              const InputInfo &Output,
586                              const InputInfoList &Inputs,
587                              const ArgList &TCArgs,
588                              const char *LinkingOutput) const;
589  };
590} // end namespace visualstudio
591
592} // end namespace toolchains
593} // end namespace driver
594} // end namespace clang
595
596#endif // CLANG_LIB_DRIVER_TOOLS_H_
597