ToolChains.h revision 5c805e92a5f70a913bc3bfcd15c44875974c2111
1//===--- ToolChains.h - ToolChain 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_TOOLCHAINS_H_
11#define CLANG_LIB_DRIVER_TOOLCHAINS_H_
12
13#include "Tools.h"
14#include "clang/Basic/VersionTuple.h"
15#include "clang/Driver/Action.h"
16#include "clang/Driver/ToolChain.h"
17#include "llvm/ADT/DenseMap.h"
18#include "llvm/Support/Compiler.h"
19#include <vector>
20#include <set>
21
22namespace clang {
23namespace driver {
24namespace toolchains {
25
26/// Generic_GCC - A tool chain using the 'gcc' command to perform
27/// all subcommands; this relies on gcc translating the majority of
28/// command line options.
29class LLVM_LIBRARY_VISIBILITY Generic_GCC : public ToolChain {
30protected:
31  /// \brief Struct to store and manipulate GCC versions.
32  ///
33  /// We rely on assumptions about the form and structure of GCC version
34  /// numbers: they consist of at most three '.'-separated components, and each
35  /// component is a non-negative integer except for the last component. For
36  /// the last component we are very flexible in order to tolerate release
37  /// candidates or 'x' wildcards.
38  ///
39  /// Note that the ordering established among GCCVersions is based on the
40  /// preferred version string to use. For example we prefer versions without
41  /// a hard-coded patch number to those with a hard coded patch number.
42  ///
43  /// Currently this doesn't provide any logic for textual suffixes to patches
44  /// in the way that (for example) Debian's version format does. If that ever
45  /// becomes necessary, it can be added.
46  struct GCCVersion {
47    /// \brief The unparsed text of the version.
48    std::string Text;
49
50    /// \brief The parsed major, minor, and patch numbers.
51    int Major, Minor, Patch;
52
53    /// \brief The text of the parsed major, and major+minor versions.
54    std::string MajorStr, MinorStr;
55
56    /// \brief Any textual suffix on the patch number.
57    std::string PatchSuffix;
58
59    static GCCVersion Parse(StringRef VersionText);
60    bool isOlderThan(int RHSMajor, int RHSMinor, int RHSPatch,
61                     StringRef RHSPatchSuffix = StringRef()) const;
62    bool operator<(const GCCVersion &RHS) const {
63      return isOlderThan(RHS.Major, RHS.Minor, RHS.Patch, RHS.PatchSuffix);
64    }
65    bool operator>(const GCCVersion &RHS) const { return RHS < *this; }
66    bool operator<=(const GCCVersion &RHS) const { return !(*this > RHS); }
67    bool operator>=(const GCCVersion &RHS) const { return !(*this < RHS); }
68  };
69
70
71  /// \brief This is a class to find a viable GCC installation for Clang to
72  /// use.
73  ///
74  /// This class tries to find a GCC installation on the system, and report
75  /// information about it. It starts from the host information provided to the
76  /// Driver, and has logic for fuzzing that where appropriate.
77  class GCCInstallationDetector {
78    bool IsValid;
79    llvm::Triple GCCTriple;
80
81    // FIXME: These might be better as path objects.
82    std::string GCCInstallPath;
83    std::string GCCBiarchSuffix;
84    std::string GCCParentLibPath;
85    std::string GCCMultiLibSuffix;
86
87    GCCVersion Version;
88
89    // We retain the list of install paths that were considered and rejected in
90    // order to print out detailed information in verbose mode.
91    std::set<std::string> CandidateGCCInstallPaths;
92
93  public:
94    GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple,
95                            const llvm::opt::ArgList &Args);
96
97    /// \brief Check whether we detected a valid GCC install.
98    bool isValid() const { return IsValid; }
99
100    /// \brief Get the GCC triple for the detected install.
101    const llvm::Triple &getTriple() const { return GCCTriple; }
102
103    /// \brief Get the detected GCC installation path.
104    StringRef getInstallPath() const { return GCCInstallPath; }
105
106    /// \brief Get the detected GCC installation path suffix for the bi-arch
107    /// target variant.
108    StringRef getBiarchSuffix() const { return GCCBiarchSuffix; }
109
110    /// \brief Get the detected GCC parent lib path.
111    StringRef getParentLibPath() const { return GCCParentLibPath; }
112
113    /// \brief Get the detected GCC lib path suffix.
114    StringRef getMultiLibSuffix() const { return GCCMultiLibSuffix; }
115
116    /// \brief Get the detected GCC version string.
117    const GCCVersion &getVersion() const { return Version; }
118
119    /// \brief Print information about the detected GCC installation.
120    void print(raw_ostream &OS) const;
121
122  private:
123    static void
124    CollectLibDirsAndTriples(const llvm::Triple &TargetTriple,
125                             const llvm::Triple &BiarchTriple,
126                             SmallVectorImpl<StringRef> &LibDirs,
127                             SmallVectorImpl<StringRef> &TripleAliases,
128                             SmallVectorImpl<StringRef> &BiarchLibDirs,
129                             SmallVectorImpl<StringRef> &BiarchTripleAliases);
130
131    void ScanLibDirForGCCTriple(llvm::Triple::ArchType TargetArch,
132                                const llvm::opt::ArgList &Args,
133                                const std::string &LibDir,
134                                StringRef CandidateTriple,
135                                bool NeedsBiarchSuffix = false);
136  };
137
138  GCCInstallationDetector GCCInstallation;
139
140public:
141  Generic_GCC(const Driver &D, const llvm::Triple &Triple,
142              const llvm::opt::ArgList &Args);
143  ~Generic_GCC();
144
145  virtual void printVerboseInfo(raw_ostream &OS) const;
146
147  virtual bool IsUnwindTablesDefault() const;
148  virtual bool isPICDefault() const;
149  virtual bool isPIEDefault() const;
150  virtual bool isPICDefaultForced() const;
151
152protected:
153  virtual Tool *getTool(Action::ActionClass AC) const;
154  virtual Tool *buildAssembler() const;
155  virtual Tool *buildLinker() const;
156
157  /// \name ToolChain Implementation Helper Functions
158  /// @{
159
160  /// \brief Check whether the target triple's architecture is 64-bits.
161  bool isTarget64Bit() const { return getTriple().isArch64Bit(); }
162
163  /// \brief Check whether the target triple's architecture is 32-bits.
164  bool isTarget32Bit() const { return getTriple().isArch32Bit(); }
165
166  /// @}
167
168private:
169  mutable OwningPtr<tools::gcc::Preprocess> Preprocess;
170  mutable OwningPtr<tools::gcc::Precompile> Precompile;
171  mutable OwningPtr<tools::gcc::Compile> Compile;
172};
173
174  /// Darwin - The base Darwin tool chain.
175class LLVM_LIBRARY_VISIBILITY Darwin : public ToolChain {
176public:
177  /// The host version.
178  unsigned DarwinVersion[3];
179
180protected:
181  virtual Tool *buildAssembler() const;
182  virtual Tool *buildLinker() const;
183  virtual Tool *getTool(Action::ActionClass AC) const;
184
185private:
186  mutable OwningPtr<tools::darwin::Lipo> Lipo;
187  mutable OwningPtr<tools::darwin::Dsymutil> Dsymutil;
188  mutable OwningPtr<tools::darwin::VerifyDebug> VerifyDebug;
189
190  /// Whether the information on the target has been initialized.
191  //
192  // FIXME: This should be eliminated. What we want to do is make this part of
193  // the "default target for arguments" selection process, once we get out of
194  // the argument translation business.
195  mutable bool TargetInitialized;
196
197  /// Whether we are targeting iPhoneOS target.
198  mutable bool TargetIsIPhoneOS;
199
200  /// Whether we are targeting the iPhoneOS simulator target.
201  mutable bool TargetIsIPhoneOSSimulator;
202
203  /// The OS version we are targeting.
204  mutable VersionTuple TargetVersion;
205
206private:
207  /// The default macosx-version-min of this tool chain; empty until
208  /// initialized.
209  std::string MacosxVersionMin;
210
211  /// The default ios-version-min of this tool chain; empty until
212  /// initialized.
213  std::string iOSVersionMin;
214
215private:
216  void AddDeploymentTarget(llvm::opt::DerivedArgList &Args) const;
217
218public:
219  Darwin(const Driver &D, const llvm::Triple &Triple,
220         const llvm::opt::ArgList &Args);
221  ~Darwin();
222
223  std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
224                                          types::ID InputType) const;
225
226  /// @name Darwin Specific Toolchain API
227  /// {
228
229  // FIXME: Eliminate these ...Target functions and derive separate tool chains
230  // for these targets and put version in constructor.
231  void setTarget(bool IsIPhoneOS, unsigned Major, unsigned Minor,
232                 unsigned Micro, bool IsIOSSim) const {
233    assert((!IsIOSSim || IsIPhoneOS) && "Unexpected deployment target!");
234
235    // FIXME: For now, allow reinitialization as long as values don't
236    // change. This will go away when we move away from argument translation.
237    if (TargetInitialized && TargetIsIPhoneOS == IsIPhoneOS &&
238        TargetIsIPhoneOSSimulator == IsIOSSim &&
239        TargetVersion == VersionTuple(Major, Minor, Micro))
240      return;
241
242    assert(!TargetInitialized && "Target already initialized!");
243    TargetInitialized = true;
244    TargetIsIPhoneOS = IsIPhoneOS;
245    TargetIsIPhoneOSSimulator = IsIOSSim;
246    TargetVersion = VersionTuple(Major, Minor, Micro);
247  }
248
249  bool isTargetIPhoneOS() const {
250    assert(TargetInitialized && "Target not initialized!");
251    return TargetIsIPhoneOS;
252  }
253
254  bool isTargetIOSSimulator() const {
255    assert(TargetInitialized && "Target not initialized!");
256    return TargetIsIPhoneOSSimulator;
257  }
258
259  bool isTargetMacOS() const {
260    return !isTargetIOSSimulator() && !isTargetIPhoneOS();
261  }
262
263  bool isTargetInitialized() const { return TargetInitialized; }
264
265  VersionTuple getTargetVersion() const {
266    assert(TargetInitialized && "Target not initialized!");
267    return TargetVersion;
268  }
269
270  /// getDarwinArchName - Get the "Darwin" arch name for a particular compiler
271  /// invocation. For example, Darwin treats different ARM variations as
272  /// distinct architectures.
273  StringRef getDarwinArchName(const llvm::opt::ArgList &Args) const;
274
275  bool isIPhoneOSVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
276    assert(isTargetIPhoneOS() && "Unexpected call for OS X target!");
277    return TargetVersion < VersionTuple(V0, V1, V2);
278  }
279
280  bool isMacosxVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
281    assert(!isTargetIPhoneOS() && "Unexpected call for iPhoneOS target!");
282    return TargetVersion < VersionTuple(V0, V1, V2);
283  }
284
285  /// AddLinkARCArgs - Add the linker arguments to link the ARC runtime library.
286  virtual void AddLinkARCArgs(const llvm::opt::ArgList &Args,
287                              llvm::opt::ArgStringList &CmdArgs) const = 0;
288
289  /// AddLinkRuntimeLibArgs - Add the linker arguments to link the compiler
290  /// runtime library.
291  virtual void
292  AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
293                        llvm::opt::ArgStringList &CmdArgs) const = 0;
294
295  /// }
296  /// @name ToolChain Implementation
297  /// {
298
299  virtual types::ID LookupTypeForExtension(const char *Ext) const;
300
301  virtual bool HasNativeLLVMSupport() const;
302
303  virtual ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const;
304  virtual bool hasBlocksRuntime() const;
305
306  virtual llvm::opt::DerivedArgList *
307  TranslateArgs(const llvm::opt::DerivedArgList &Args,
308                const char *BoundArch) const;
309
310  virtual bool IsBlocksDefault() const {
311    // Always allow blocks on Darwin; users interested in versioning are
312    // expected to use /usr/include/Blocks.h.
313    return true;
314  }
315  virtual bool IsIntegratedAssemblerDefault() const {
316#ifdef DISABLE_DEFAULT_INTEGRATED_ASSEMBLER
317    return false;
318#else
319    // Default integrated assembler to on for Darwin.
320    return true;
321#endif
322  }
323  virtual bool IsStrictAliasingDefault() const {
324#ifdef DISABLE_DEFAULT_STRICT_ALIASING
325    return false;
326#else
327    return ToolChain::IsStrictAliasingDefault();
328#endif
329  }
330
331  virtual bool IsMathErrnoDefault() const {
332    return false;
333  }
334
335  virtual bool IsEncodeExtendedBlockSignatureDefault() const {
336    return true;
337  }
338
339  virtual bool IsObjCNonFragileABIDefault() const {
340    // Non-fragile ABI is default for everything but i386.
341    return getTriple().getArch() != llvm::Triple::x86;
342  }
343
344  virtual bool UseObjCMixedDispatch() const {
345    // This is only used with the non-fragile ABI and non-legacy dispatch.
346
347    // Mixed dispatch is used everywhere except OS X before 10.6.
348    return !(!isTargetIPhoneOS() && isMacosxVersionLT(10, 6));
349  }
350  virtual bool IsUnwindTablesDefault() const;
351  virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
352    // Stack protectors default to on for user code on 10.5,
353    // and for everything in 10.6 and beyond
354    return isTargetIPhoneOS() ||
355      (!isMacosxVersionLT(10, 6) ||
356         (!isMacosxVersionLT(10, 5) && !KernelOrKext));
357  }
358  virtual RuntimeLibType GetDefaultRuntimeLibType() const {
359    return ToolChain::RLT_CompilerRT;
360  }
361  virtual bool isPICDefault() const;
362  virtual bool isPIEDefault() const;
363  virtual bool isPICDefaultForced() const;
364
365  virtual bool SupportsProfiling() const;
366
367  virtual bool SupportsObjCGC() const;
368
369  virtual void CheckObjCARC() const;
370
371  virtual bool UseDwarfDebugFlags() const;
372
373  virtual bool UseSjLjExceptions() const;
374
375  /// }
376};
377
378/// DarwinClang - The Darwin toolchain used by Clang.
379class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin {
380public:
381  DarwinClang(const Driver &D, const llvm::Triple &Triple,
382              const llvm::opt::ArgList &Args);
383
384  /// @name Darwin ToolChain Implementation
385  /// {
386
387  virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
388                                     llvm::opt::ArgStringList &CmdArgs) const;
389  void AddLinkRuntimeLib(const llvm::opt::ArgList &Args,
390                         llvm::opt::ArgStringList &CmdArgs,
391                         const char *DarwinStaticLib,
392                         bool AlwaysLink = false) const;
393
394  virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
395                                   llvm::opt::ArgStringList &CmdArgs) const;
396
397  virtual void AddCCKextLibArgs(const llvm::opt::ArgList &Args,
398                                llvm::opt::ArgStringList &CmdArgs) const;
399
400  virtual void AddLinkARCArgs(const llvm::opt::ArgList &Args,
401                              llvm::opt::ArgStringList &CmdArgs) const;
402  /// }
403};
404
405/// Darwin_Generic_GCC - Generic Darwin tool chain using gcc.
406class LLVM_LIBRARY_VISIBILITY Darwin_Generic_GCC : public Generic_GCC {
407public:
408  Darwin_Generic_GCC(const Driver &D, const llvm::Triple &Triple,
409                     const llvm::opt::ArgList &Args)
410      : Generic_GCC(D, Triple, Args) {}
411
412  std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
413                                          types::ID InputType) const;
414
415  virtual bool isPICDefault() const { return false; }
416};
417
418class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Generic_GCC {
419  virtual void anchor();
420public:
421  Generic_ELF(const Driver &D, const llvm::Triple &Triple,
422              const llvm::opt::ArgList &Args)
423      : Generic_GCC(D, Triple, Args) {}
424
425  virtual bool IsIntegratedAssemblerDefault() const {
426    // Default integrated assembler to on for x86.
427    return (getTriple().getArch() == llvm::Triple::aarch64 ||
428            getTriple().getArch() == llvm::Triple::x86 ||
429            getTriple().getArch() == llvm::Triple::x86_64);
430  }
431};
432
433class LLVM_LIBRARY_VISIBILITY AuroraUX : public Generic_GCC {
434public:
435  AuroraUX(const Driver &D, const llvm::Triple &Triple,
436           const llvm::opt::ArgList &Args);
437
438protected:
439  virtual Tool *buildAssembler() const;
440  virtual Tool *buildLinker() const;
441};
442
443class LLVM_LIBRARY_VISIBILITY Solaris : public Generic_GCC {
444public:
445  Solaris(const Driver &D, const llvm::Triple &Triple,
446          const llvm::opt::ArgList &Args);
447
448  virtual bool IsIntegratedAssemblerDefault() const { return true; }
449protected:
450  virtual Tool *buildAssembler() const;
451  virtual Tool *buildLinker() const;
452
453};
454
455
456class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
457public:
458  OpenBSD(const Driver &D, const llvm::Triple &Triple,
459          const llvm::opt::ArgList &Args);
460
461  virtual bool IsMathErrnoDefault() const { return false; }
462  virtual bool IsObjCNonFragileABIDefault() const { return true; }
463  virtual bool isPIEDefault() const { return true; }
464
465  virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
466    return 1;
467  }
468
469protected:
470  virtual Tool *buildAssembler() const;
471  virtual Tool *buildLinker() const;
472};
473
474class LLVM_LIBRARY_VISIBILITY Bitrig : public Generic_ELF {
475public:
476  Bitrig(const Driver &D, const llvm::Triple &Triple,
477         const llvm::opt::ArgList &Args);
478
479  virtual bool IsMathErrnoDefault() const { return false; }
480  virtual bool IsObjCNonFragileABIDefault() const { return true; }
481  virtual bool IsObjCLegacyDispatchDefault() const { return false; }
482
483  virtual void
484  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
485                               llvm::opt::ArgStringList &CC1Args) const;
486  virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
487                                   llvm::opt::ArgStringList &CmdArgs) const;
488  virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
489     return 1;
490  }
491
492protected:
493  virtual Tool *buildAssembler() const;
494  virtual Tool *buildLinker() const;
495};
496
497class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
498public:
499  FreeBSD(const Driver &D, const llvm::Triple &Triple,
500          const llvm::opt::ArgList &Args);
501
502  virtual bool IsMathErrnoDefault() const { return false; }
503  virtual bool IsObjCNonFragileABIDefault() const { return true; }
504
505  virtual bool UseSjLjExceptions() const;
506protected:
507  virtual Tool *buildAssembler() const;
508  virtual Tool *buildLinker() const;
509};
510
511class LLVM_LIBRARY_VISIBILITY NetBSD : public Generic_ELF {
512public:
513  NetBSD(const Driver &D, const llvm::Triple &Triple,
514         const llvm::opt::ArgList &Args);
515
516  virtual bool IsMathErrnoDefault() const { return false; }
517  virtual bool IsObjCNonFragileABIDefault() const { return true; }
518
519  virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const;
520
521  virtual void
522  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
523                               llvm::opt::ArgStringList &CC1Args) const;
524  virtual bool IsUnwindTablesDefault() const {
525    return true;
526  }
527  virtual bool IsIntegratedAssemblerDefault() const {
528    if (getTriple().getArch() == llvm::Triple::ppc)
529      return true;
530    return Generic_ELF::IsIntegratedAssemblerDefault();
531  }
532
533protected:
534  virtual Tool *buildAssembler() const;
535  virtual Tool *buildLinker() const;
536};
537
538class LLVM_LIBRARY_VISIBILITY Minix : public Generic_ELF {
539public:
540  Minix(const Driver &D, const llvm::Triple &Triple,
541        const llvm::opt::ArgList &Args);
542
543protected:
544  virtual Tool *buildAssembler() const;
545  virtual Tool *buildLinker() const;
546};
547
548class LLVM_LIBRARY_VISIBILITY DragonFly : public Generic_ELF {
549public:
550  DragonFly(const Driver &D, const llvm::Triple &Triple,
551            const llvm::opt::ArgList &Args);
552
553  virtual bool IsMathErrnoDefault() const { return false; }
554
555protected:
556  virtual Tool *buildAssembler() const;
557  virtual Tool *buildLinker() const;
558};
559
560class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF {
561public:
562  Linux(const Driver &D, const llvm::Triple &Triple,
563        const llvm::opt::ArgList &Args);
564
565  virtual bool HasNativeLLVMSupport() const;
566
567  virtual void
568  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
569                            llvm::opt::ArgStringList &CC1Args) const;
570  virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
571                                     llvm::opt::ArgStringList &CC1Args) const;
572  virtual void
573  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
574                               llvm::opt::ArgStringList &CC1Args) const;
575  virtual bool isPIEDefault() const;
576
577  std::string Linker;
578  std::vector<std::string> ExtraOpts;
579
580protected:
581  virtual Tool *buildAssembler() const;
582  virtual Tool *buildLinker() const;
583
584private:
585  static bool addLibStdCXXIncludePaths(Twine Base, Twine Suffix,
586                                       Twine TargetArchDir,
587                                       Twine MultiLibSuffix,
588                                       const llvm::opt::ArgList &DriverArgs,
589                                       llvm::opt::ArgStringList &CC1Args);
590  static bool addLibStdCXXIncludePaths(Twine Base, Twine TargetArchDir,
591                                       const llvm::opt::ArgList &DriverArgs,
592                                       llvm::opt::ArgStringList &CC1Args);
593
594  std::string computeSysRoot(const llvm::opt::ArgList &Args) const;
595};
596
597class LLVM_LIBRARY_VISIBILITY Hexagon_TC : public Linux {
598protected:
599  GCCVersion GCCLibAndIncVersion;
600  virtual Tool *buildAssembler() const;
601  virtual Tool *buildLinker() const;
602
603public:
604  Hexagon_TC(const Driver &D, const llvm::Triple &Triple,
605             const llvm::opt::ArgList &Args);
606  ~Hexagon_TC();
607
608  virtual void
609  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
610                            llvm::opt::ArgStringList &CC1Args) const;
611  virtual void
612  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
613                               llvm::opt::ArgStringList &CC1Args) const;
614  virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const;
615
616  StringRef GetGCCLibAndIncVersion() const { return GCCLibAndIncVersion.Text; }
617
618  static std::string GetGnuDir(const std::string &InstalledDir);
619
620  static StringRef GetTargetCPU(const llvm::opt::ArgList &Args);
621};
622
623/// TCEToolChain - A tool chain using the llvm bitcode tools to perform
624/// all subcommands. See http://tce.cs.tut.fi for our peculiar target.
625class LLVM_LIBRARY_VISIBILITY TCEToolChain : public ToolChain {
626public:
627  TCEToolChain(const Driver &D, const llvm::Triple &Triple,
628               const llvm::opt::ArgList &Args);
629  ~TCEToolChain();
630
631  bool IsMathErrnoDefault() const;
632  bool isPICDefault() const;
633  bool isPIEDefault() const;
634  bool isPICDefaultForced() const;
635};
636
637class LLVM_LIBRARY_VISIBILITY Windows : public ToolChain {
638public:
639  Windows(const Driver &D, const llvm::Triple &Triple,
640          const llvm::opt::ArgList &Args);
641
642  virtual bool IsIntegratedAssemblerDefault() const;
643  virtual bool IsUnwindTablesDefault() const;
644  virtual bool isPICDefault() const;
645  virtual bool isPIEDefault() const;
646  virtual bool isPICDefaultForced() const;
647
648  virtual void
649  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
650                            llvm::opt::ArgStringList &CC1Args) const;
651  virtual void
652  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
653                               llvm::opt::ArgStringList &CC1Args) const;
654
655protected:
656  virtual Tool *buildLinker() const;
657  virtual Tool *buildAssembler() const;
658};
659
660} // end namespace toolchains
661} // end namespace driver
662} // end namespace clang
663
664#endif
665