]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/lib/Driver/Tools.h
Upgrade our copy of clang, llvm and lldb to 3.5.0 release.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / lib / Driver / Tools.h
1 //===--- Tools.h - Tool Implementations -------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef CLANG_LIB_DRIVER_TOOLS_H_
11 #define CLANG_LIB_DRIVER_TOOLS_H_
12
13 #include "clang/Driver/Tool.h"
14 #include "clang/Driver/Types.h"
15 #include "clang/Driver/Util.h"
16 #include "llvm/ADT/Triple.h"
17 #include "llvm/Option/Option.h"
18 #include "llvm/Support/Compiler.h"
19
20 namespace clang {
21   class ObjCRuntime;
22
23 namespace driver {
24   class Command;
25   class Driver;
26
27 namespace toolchains {
28   class MachO;
29 }
30
31 namespace tools {
32
33 namespace visualstudio {
34   class Compile;
35 }
36
37 using llvm::opt::ArgStringList;
38
39   /// \brief Clang compiler tool.
40   class LLVM_LIBRARY_VISIBILITY Clang : public Tool {
41   public:
42     static const char *getBaseInputName(const llvm::opt::ArgList &Args,
43                                         const InputInfoList &Inputs);
44     static const char *getBaseInputStem(const llvm::opt::ArgList &Args,
45                                         const InputInfoList &Inputs);
46     static const char *getDependencyFileName(const llvm::opt::ArgList &Args,
47                                              const InputInfoList &Inputs);
48
49   private:
50     void AddPreprocessingOptions(Compilation &C, const JobAction &JA,
51                                  const Driver &D,
52                                  const llvm::opt::ArgList &Args,
53                                  llvm::opt::ArgStringList &CmdArgs,
54                                  const InputInfo &Output,
55                                  const InputInfoList &Inputs) const;
56
57     void AddAArch64TargetArgs(const llvm::opt::ArgList &Args,
58                               llvm::opt::ArgStringList &CmdArgs) const;
59     void AddARMTargetArgs(const llvm::opt::ArgList &Args,
60                           llvm::opt::ArgStringList &CmdArgs,
61                           bool KernelOrKext) const;
62     void AddARM64TargetArgs(const llvm::opt::ArgList &Args,
63                             llvm::opt::ArgStringList &CmdArgs) const;
64     void AddMIPSTargetArgs(const llvm::opt::ArgList &Args,
65                            llvm::opt::ArgStringList &CmdArgs) const;
66     void AddR600TargetArgs(const llvm::opt::ArgList &Args,
67                            llvm::opt::ArgStringList &CmdArgs) const;
68     void AddSparcTargetArgs(const llvm::opt::ArgList &Args,
69                             llvm::opt::ArgStringList &CmdArgs) const;
70     void AddSystemZTargetArgs(const llvm::opt::ArgList &Args,
71                               llvm::opt::ArgStringList &CmdArgs) const;
72     void AddX86TargetArgs(const llvm::opt::ArgList &Args,
73                           llvm::opt::ArgStringList &CmdArgs) const;
74     void AddHexagonTargetArgs(const llvm::opt::ArgList &Args,
75                               llvm::opt::ArgStringList &CmdArgs) const;
76
77     enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile };
78
79     ObjCRuntime AddObjCRuntimeArgs(const llvm::opt::ArgList &args,
80                                    llvm::opt::ArgStringList &cmdArgs,
81                                    RewriteKind rewrite) const;
82
83     void AddClangCLArgs(const llvm::opt::ArgList &Args,
84                         llvm::opt::ArgStringList &CmdArgs) const;
85
86     visualstudio::Compile *getCLFallback() const;
87
88     mutable std::unique_ptr<visualstudio::Compile> CLFallback;
89
90   public:
91     Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {}
92
93     bool hasGoodDiagnostics() const override { return true; }
94     bool hasIntegratedAssembler() const override { return true; }
95     bool hasIntegratedCPP() const override { return true; }
96
97     void ConstructJob(Compilation &C, const JobAction &JA,
98                       const InputInfo &Output, const InputInfoList &Inputs,
99                       const llvm::opt::ArgList &TCArgs,
100                       const char *LinkingOutput) const override;
101   };
102
103   /// \brief Clang integrated assembler tool.
104   class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool {
105   public:
106     ClangAs(const ToolChain &TC) : Tool("clang::as",
107                                         "clang integrated assembler", TC) {}
108
109     bool hasGoodDiagnostics() const override { return true; }
110     bool hasIntegratedAssembler() const override { return false; }
111     bool hasIntegratedCPP() const override { return false; }
112
113     void ConstructJob(Compilation &C, const JobAction &JA,
114                       const InputInfo &Output, const InputInfoList &Inputs,
115                       const llvm::opt::ArgList &TCArgs,
116                       const char *LinkingOutput) const override;
117   };
118
119   /// gcc - Generic GCC tool implementations.
120 namespace gcc {
121   class LLVM_LIBRARY_VISIBILITY Common : public Tool {
122   public:
123     Common(const char *Name, const char *ShortName,
124            const ToolChain &TC) : Tool(Name, ShortName, TC) {}
125
126     void ConstructJob(Compilation &C, const JobAction &JA,
127                       const InputInfo &Output,
128                       const InputInfoList &Inputs,
129                       const llvm::opt::ArgList &TCArgs,
130                       const char *LinkingOutput) const override;
131
132     /// RenderExtraToolArgs - Render any arguments necessary to force
133     /// the particular tool mode.
134     virtual void
135         RenderExtraToolArgs(const JobAction &JA,
136                             llvm::opt::ArgStringList &CmdArgs) const = 0;
137   };
138
139   class LLVM_LIBRARY_VISIBILITY Preprocess : public Common {
140   public:
141     Preprocess(const ToolChain &TC) : Common("gcc::Preprocess",
142                                              "gcc preprocessor", TC) {}
143
144     bool hasGoodDiagnostics() const override { return true; }
145     bool hasIntegratedCPP() const override { return false; }
146
147     void RenderExtraToolArgs(const JobAction &JA,
148                              llvm::opt::ArgStringList &CmdArgs) const override;
149   };
150
151   class LLVM_LIBRARY_VISIBILITY Compile : public Common  {
152   public:
153     Compile(const ToolChain &TC) : Common("gcc::Compile",
154                                           "gcc frontend", TC) {}
155
156     bool hasGoodDiagnostics() const override { return true; }
157     bool hasIntegratedCPP() const override { return true; }
158
159     void RenderExtraToolArgs(const JobAction &JA,
160                              llvm::opt::ArgStringList &CmdArgs) const override;
161   };
162
163   class LLVM_LIBRARY_VISIBILITY Link : public Common  {
164   public:
165     Link(const ToolChain &TC) : Common("gcc::Link",
166                                        "linker (via gcc)", TC) {}
167
168     bool hasIntegratedCPP() const override { return false; }
169     bool isLinkJob() const override { return true; }
170
171     void RenderExtraToolArgs(const JobAction &JA,
172                              llvm::opt::ArgStringList &CmdArgs) const override;
173   };
174 } // end namespace gcc
175
176 namespace hexagon {
177   // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile.
178   // We simply use "clang -cc1" for those actions.
179   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
180   public:
181     Assemble(const ToolChain &TC) : Tool("hexagon::Assemble",
182       "hexagon-as", TC) {}
183
184     bool hasIntegratedCPP() const override { return false; }
185
186     void RenderExtraToolArgs(const JobAction &JA,
187                              llvm::opt::ArgStringList &CmdArgs) const;
188     void ConstructJob(Compilation &C, const JobAction &JA,
189                       const InputInfo &Output, const InputInfoList &Inputs,
190                       const llvm::opt::ArgList &TCArgs,
191                       const char *LinkingOutput) const override;
192   };
193
194   class LLVM_LIBRARY_VISIBILITY Link : public Tool {
195   public:
196     Link(const ToolChain &TC) : Tool("hexagon::Link",
197       "hexagon-ld", TC) {}
198
199     bool hasIntegratedCPP() const override { return false; }
200     bool isLinkJob() const override { return true; }
201
202     virtual void RenderExtraToolArgs(const JobAction &JA,
203                                      llvm::opt::ArgStringList &CmdArgs) const;
204     void ConstructJob(Compilation &C, const JobAction &JA,
205                       const InputInfo &Output, const InputInfoList &Inputs,
206                       const llvm::opt::ArgList &TCArgs,
207                       const char *LinkingOutput) const override;
208   };
209 } // end namespace hexagon.
210
211 namespace arm {
212   StringRef getARMTargetCPU(const llvm::opt::ArgList &Args,
213                             const llvm::Triple &Triple);
214   const char* getARMCPUForMArch(const llvm::opt::ArgList &Args,
215                                 const llvm::Triple &Triple);
216   const char* getLLVMArchSuffixForARM(StringRef CPU);
217 }
218
219 namespace mips {
220   void getMipsCPUAndABI(const llvm::opt::ArgList &Args,
221                         const llvm::Triple &Triple, StringRef &CPUName,
222                         StringRef &ABIName);
223   bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value);
224   bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);
225   bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName,
226                      StringRef ABIName);
227 }
228
229 namespace darwin {
230   llvm::Triple::ArchType getArchTypeForMachOArchName(StringRef Str);
231   void setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str);
232
233   class LLVM_LIBRARY_VISIBILITY MachOTool : public Tool {
234     virtual void anchor();
235   protected:
236     void AddMachOArch(const llvm::opt::ArgList &Args,
237                        llvm::opt::ArgStringList &CmdArgs) const;
238
239     const toolchains::MachO &getMachOToolChain() const {
240       return reinterpret_cast<const toolchains::MachO&>(getToolChain());
241     }
242
243   public:
244     MachOTool(const char *Name, const char *ShortName,
245                const ToolChain &TC) : Tool(Name, ShortName, TC) {}
246   };
247
248   class LLVM_LIBRARY_VISIBILITY Assemble : public MachOTool  {
249   public:
250     Assemble(const ToolChain &TC) : MachOTool("darwin::Assemble",
251                                               "assembler", TC) {}
252
253     bool hasIntegratedCPP() const override { return false; }
254
255     void ConstructJob(Compilation &C, const JobAction &JA,
256                       const InputInfo &Output, const InputInfoList &Inputs,
257                       const llvm::opt::ArgList &TCArgs,
258                       const char *LinkingOutput) const override;
259   };
260
261   class LLVM_LIBRARY_VISIBILITY Link : public MachOTool  {
262     bool NeedsTempPath(const InputInfoList &Inputs) const;
263     void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args,
264                      llvm::opt::ArgStringList &CmdArgs,
265                      const InputInfoList &Inputs) const;
266
267   public:
268     Link(const ToolChain &TC) : MachOTool("darwin::Link", "linker", TC) {}
269
270     bool hasIntegratedCPP() const override { return false; }
271     bool isLinkJob() const override { return true; }
272
273     void ConstructJob(Compilation &C, const JobAction &JA,
274                       const InputInfo &Output, const InputInfoList &Inputs,
275                       const llvm::opt::ArgList &TCArgs,
276                       const char *LinkingOutput) const override;
277   };
278
279   class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool  {
280   public:
281     Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {}
282
283     bool hasIntegratedCPP() const override { return false; }
284
285     void ConstructJob(Compilation &C, const JobAction &JA,
286                       const InputInfo &Output, const InputInfoList &Inputs,
287                       const llvm::opt::ArgList &TCArgs,
288                       const char *LinkingOutput) const override;
289   };
290
291   class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool  {
292   public:
293     Dsymutil(const ToolChain &TC) : MachOTool("darwin::Dsymutil",
294                                               "dsymutil", TC) {}
295
296     bool hasIntegratedCPP() const override { return false; }
297     bool isDsymutilJob() const override { return true; }
298
299     void ConstructJob(Compilation &C, const JobAction &JA,
300                       const InputInfo &Output,
301                       const InputInfoList &Inputs,
302                       const llvm::opt::ArgList &TCArgs,
303                       const char *LinkingOutput) const override;
304   };
305
306   class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool  {
307   public:
308     VerifyDebug(const ToolChain &TC) : MachOTool("darwin::VerifyDebug",
309                                                  "dwarfdump", TC) {}
310
311     bool hasIntegratedCPP() const override { return false; }
312
313     void ConstructJob(Compilation &C, const JobAction &JA,
314                       const InputInfo &Output, const InputInfoList &Inputs,
315                       const llvm::opt::ArgList &TCArgs,
316                       const char *LinkingOutput) const override;
317   };
318
319 }
320
321   /// openbsd -- Directly call GNU Binutils assembler and linker
322 namespace openbsd {
323   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
324   public:
325     Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler",
326                                          TC) {}
327
328     bool hasIntegratedCPP() const override { return false; }
329
330     void ConstructJob(Compilation &C, const JobAction &JA,
331                       const InputInfo &Output,
332                       const InputInfoList &Inputs,
333                       const llvm::opt::ArgList &TCArgs,
334                       const char *LinkingOutput) const override;
335   };
336   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
337   public:
338     Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {}
339
340     bool hasIntegratedCPP() const override { return false; }
341     bool isLinkJob() const override { return true; }
342
343     void ConstructJob(Compilation &C, const JobAction &JA,
344                       const InputInfo &Output, const InputInfoList &Inputs,
345                       const llvm::opt::ArgList &TCArgs,
346                       const char *LinkingOutput) const override;
347   };
348 } // end namespace openbsd
349
350   /// bitrig -- Directly call GNU Binutils assembler and linker
351 namespace bitrig {
352   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
353   public:
354     Assemble(const ToolChain &TC) : Tool("bitrig::Assemble", "assembler",
355                                          TC) {}
356
357     bool hasIntegratedCPP() const override { return false; }
358
359     void ConstructJob(Compilation &C, const JobAction &JA,
360                       const InputInfo &Output, const InputInfoList &Inputs,
361                       const llvm::opt::ArgList &TCArgs,
362                       const char *LinkingOutput) const override;
363   };
364   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
365   public:
366     Link(const ToolChain &TC) : Tool("bitrig::Link", "linker", TC) {}
367
368     bool hasIntegratedCPP() const override { return false; }
369     bool isLinkJob() const override { return true; }
370
371     void ConstructJob(Compilation &C, const JobAction &JA,
372                       const InputInfo &Output, const InputInfoList &Inputs,
373                       const llvm::opt::ArgList &TCArgs,
374                       const char *LinkingOutput) const override;
375   };
376 } // end namespace bitrig
377
378   /// freebsd -- Directly call GNU Binutils assembler and linker
379 namespace freebsd {
380   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
381   public:
382     Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler",
383                                          TC) {}
384
385     bool hasIntegratedCPP() const override { return false; }
386
387     void ConstructJob(Compilation &C, const JobAction &JA,
388                       const InputInfo &Output, const InputInfoList &Inputs,
389                       const llvm::opt::ArgList &TCArgs,
390                       const char *LinkingOutput) const override;
391   };
392   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
393   public:
394     Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {}
395
396     bool hasIntegratedCPP() const override { return false; }
397     bool isLinkJob() const override { return true; }
398
399     void ConstructJob(Compilation &C, const JobAction &JA,
400                       const InputInfo &Output, const InputInfoList &Inputs,
401                       const llvm::opt::ArgList &TCArgs,
402                       const char *LinkingOutput) const override;
403   };
404 } // end namespace freebsd
405
406   /// netbsd -- Directly call GNU Binutils assembler and linker
407 namespace netbsd {
408   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
409
410   public:
411     Assemble(const ToolChain &TC)
412       : Tool("netbsd::Assemble", "assembler", TC) {}
413
414     bool hasIntegratedCPP() const override { return false; }
415
416     void ConstructJob(Compilation &C, const JobAction &JA,
417                       const InputInfo &Output, const InputInfoList &Inputs,
418                       const llvm::opt::ArgList &TCArgs,
419                       const char *LinkingOutput) const override;
420   };
421   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
422
423   public:
424     Link(const ToolChain &TC)
425       : Tool("netbsd::Link", "linker", TC) {}
426
427     bool hasIntegratedCPP() const override { return false; }
428     bool isLinkJob() const override { return true; }
429
430     void ConstructJob(Compilation &C, const JobAction &JA,
431                       const InputInfo &Output, const InputInfoList &Inputs,
432                       const llvm::opt::ArgList &TCArgs,
433                       const char *LinkingOutput) const override;
434   };
435 } // end namespace netbsd
436
437   /// Directly call GNU Binutils' assembler and linker.
438 namespace gnutools {
439   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
440   public:
441     Assemble(const ToolChain &TC) : Tool("GNU::Assemble", "assembler", TC) {}
442
443     bool hasIntegratedCPP() const override { return false; }
444
445     void ConstructJob(Compilation &C, const JobAction &JA,
446                       const InputInfo &Output,
447                       const InputInfoList &Inputs,
448                       const llvm::opt::ArgList &TCArgs,
449                       const char *LinkingOutput) const override;
450   };
451   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
452   public:
453     Link(const ToolChain &TC) : Tool("GNU::Link", "linker", TC) {}
454
455     bool hasIntegratedCPP() const override { return false; }
456     bool isLinkJob() const override { return true; }
457
458     void ConstructJob(Compilation &C, const JobAction &JA,
459                       const InputInfo &Output,
460                       const InputInfoList &Inputs,
461                       const llvm::opt::ArgList &TCArgs,
462                       const char *LinkingOutput) const override;
463   };
464 }
465   /// minix -- Directly call GNU Binutils assembler and linker
466 namespace minix {
467   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
468   public:
469     Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler",
470                                          TC) {}
471
472     bool hasIntegratedCPP() const override { return false; }
473
474     void ConstructJob(Compilation &C, const JobAction &JA,
475                       const InputInfo &Output,
476                       const InputInfoList &Inputs,
477                       const llvm::opt::ArgList &TCArgs,
478                       const char *LinkingOutput) const override;
479   };
480   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
481   public:
482     Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {}
483
484     bool hasIntegratedCPP() const override { return false; }
485     bool isLinkJob() const override { return true; }
486
487     void ConstructJob(Compilation &C, const JobAction &JA,
488                       const InputInfo &Output,
489                       const InputInfoList &Inputs,
490                       const llvm::opt::ArgList &TCArgs,
491                       const char *LinkingOutput) const override;
492   };
493 } // end namespace minix
494
495   /// solaris -- Directly call Solaris assembler and linker
496 namespace solaris {
497   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
498   public:
499     Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler",
500                                          TC) {}
501
502     bool hasIntegratedCPP() const override { return false; }
503
504     void ConstructJob(Compilation &C, const JobAction &JA,
505                       const InputInfo &Output, const InputInfoList &Inputs,
506                       const llvm::opt::ArgList &TCArgs,
507                       const char *LinkingOutput) const override;
508   };
509   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
510   public:
511     Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {}
512
513     bool hasIntegratedCPP() const override { return false; }
514     bool isLinkJob() const override { return true; }
515
516     void ConstructJob(Compilation &C, const JobAction &JA,
517                       const InputInfo &Output, const InputInfoList &Inputs,
518                       const llvm::opt::ArgList &TCArgs,
519                       const char *LinkingOutput) const override;
520   };
521 } // end namespace solaris
522
523   /// auroraux -- Directly call GNU Binutils assembler and linker
524 namespace auroraux {
525   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
526   public:
527     Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler",
528                                          TC) {}
529
530     bool hasIntegratedCPP() const override { return false; }
531
532     void ConstructJob(Compilation &C, const JobAction &JA,
533                       const InputInfo &Output, const InputInfoList &Inputs,
534                       const llvm::opt::ArgList &TCArgs,
535                       const char *LinkingOutput) const override;
536   };
537   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
538   public:
539     Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {}
540
541     bool hasIntegratedCPP() const override { return false; }
542     bool isLinkJob() const override { return true; }
543
544     void ConstructJob(Compilation &C, const JobAction &JA,
545                       const InputInfo &Output, const InputInfoList &Inputs,
546                       const llvm::opt::ArgList &TCArgs,
547                       const char *LinkingOutput) const override;
548   };
549 } // end namespace auroraux
550
551   /// dragonfly -- Directly call GNU Binutils assembler and linker
552 namespace dragonfly {
553   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool  {
554   public:
555     Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler",
556                                          TC) {}
557
558     bool hasIntegratedCPP() const override { return false; }
559
560     void ConstructJob(Compilation &C, const JobAction &JA,
561                       const InputInfo &Output, const InputInfoList &Inputs,
562                       const llvm::opt::ArgList &TCArgs,
563                       const char *LinkingOutput) const override;
564   };
565   class LLVM_LIBRARY_VISIBILITY Link : public Tool  {
566   public:
567     Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {}
568
569     bool hasIntegratedCPP() const override { return false; }
570     bool isLinkJob() const override { return true; }
571
572     void ConstructJob(Compilation &C, const JobAction &JA,
573                       const InputInfo &Output,
574                       const InputInfoList &Inputs,
575                       const llvm::opt::ArgList &TCArgs,
576                       const char *LinkingOutput) const override;
577   };
578 } // end namespace dragonfly
579
580 /// Visual studio tools.
581 namespace visualstudio {
582   class LLVM_LIBRARY_VISIBILITY Link : public Tool {
583   public:
584     Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {}
585
586     bool hasIntegratedCPP() const override { return false; }
587     bool isLinkJob() const override { return true; }
588
589     void ConstructJob(Compilation &C, const JobAction &JA,
590                       const InputInfo &Output, const InputInfoList &Inputs,
591                       const llvm::opt::ArgList &TCArgs,
592                       const char *LinkingOutput) const override;
593   };
594
595   class LLVM_LIBRARY_VISIBILITY Compile : public Tool {
596   public:
597     Compile(const ToolChain &TC) : Tool("visualstudio::Compile", "compiler", TC) {}
598
599     bool hasIntegratedAssembler() const override { return true; }
600     bool hasIntegratedCPP() const override { return true; }
601     bool isLinkJob() const override { return false; }
602
603     void ConstructJob(Compilation &C, const JobAction &JA,
604                       const InputInfo &Output, const InputInfoList &Inputs,
605                       const llvm::opt::ArgList &TCArgs,
606                       const char *LinkingOutput) const override;
607
608     Command *GetCommand(Compilation &C, const JobAction &JA,
609                         const InputInfo &Output,
610                         const InputInfoList &Inputs,
611                         const llvm::opt::ArgList &TCArgs,
612                         const char *LinkingOutput) const;
613   };
614 } // end namespace visualstudio
615
616 namespace arm {
617   StringRef getARMFloatABI(const Driver &D, const llvm::opt::ArgList &Args,
618                          const llvm::Triple &Triple);
619 }
620 namespace XCore {
621   // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and Compile.
622   // We simply use "clang -cc1" for those actions.
623   class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
624   public:
625     Assemble(const ToolChain &TC) : Tool("XCore::Assemble",
626       "XCore-as", TC) {}
627
628     bool hasIntegratedCPP() const override { return false; }
629     void ConstructJob(Compilation &C, const JobAction &JA,
630                       const InputInfo &Output, const InputInfoList &Inputs,
631                       const llvm::opt::ArgList &TCArgs,
632                       const char *LinkingOutput) const override;
633   };
634
635   class LLVM_LIBRARY_VISIBILITY Link : public Tool {
636   public:
637     Link(const ToolChain &TC) : Tool("XCore::Link",
638       "XCore-ld", TC) {}
639
640     bool hasIntegratedCPP() const override { return false; }
641     bool isLinkJob() const override { return true; }
642     void ConstructJob(Compilation &C, const JobAction &JA,
643                       const InputInfo &Output, const InputInfoList &Inputs,
644                       const llvm::opt::ArgList &TCArgs,
645                       const char *LinkingOutput) const override;
646   };
647 } // end namespace XCore.
648
649
650 } // end namespace toolchains
651 } // end namespace driver
652 } // end namespace clang
653
654 #endif // CLANG_LIB_DRIVER_TOOLS_H_