1 //===--- ToolChains.h - ToolChain Implementations ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef CLANG_LIB_DRIVER_TOOLCHAINS_H_
11 #define CLANG_LIB_DRIVER_TOOLCHAINS_H_
14 #include "clang/Basic/VersionTuple.h"
15 #include "clang/Driver/Action.h"
16 #include "clang/Driver/Multilib.h"
17 #include "clang/Driver/ToolChain.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/Support/Compiler.h"
26 namespace toolchains {
28 /// Generic_GCC - A tool chain using the 'gcc' command to perform
29 /// all subcommands; this relies on gcc translating the majority of
30 /// command line options.
31 class LLVM_LIBRARY_VISIBILITY Generic_GCC : public ToolChain {
33 /// \brief Struct to store and manipulate GCC versions.
35 /// We rely on assumptions about the form and structure of GCC version
36 /// numbers: they consist of at most three '.'-separated components, and each
37 /// component is a non-negative integer except for the last component. For
38 /// the last component we are very flexible in order to tolerate release
39 /// candidates or 'x' wildcards.
41 /// Note that the ordering established among GCCVersions is based on the
42 /// preferred version string to use. For example we prefer versions without
43 /// a hard-coded patch number to those with a hard coded patch number.
45 /// Currently this doesn't provide any logic for textual suffixes to patches
46 /// in the way that (for example) Debian's version format does. If that ever
47 /// becomes necessary, it can be added.
49 /// \brief The unparsed text of the version.
52 /// \brief The parsed major, minor, and patch numbers.
53 int Major, Minor, Patch;
55 /// \brief The text of the parsed major, and major+minor versions.
56 std::string MajorStr, MinorStr;
58 /// \brief Any textual suffix on the patch number.
59 std::string PatchSuffix;
61 static GCCVersion Parse(StringRef VersionText);
62 bool isOlderThan(int RHSMajor, int RHSMinor, int RHSPatch,
63 StringRef RHSPatchSuffix = StringRef()) const;
64 bool operator<(const GCCVersion &RHS) const {
65 return isOlderThan(RHS.Major, RHS.Minor, RHS.Patch, RHS.PatchSuffix);
67 bool operator>(const GCCVersion &RHS) const { return RHS < *this; }
68 bool operator<=(const GCCVersion &RHS) const { return !(*this > RHS); }
69 bool operator>=(const GCCVersion &RHS) const { return !(*this < RHS); }
72 /// \brief This is a class to find a viable GCC installation for Clang to
75 /// This class tries to find a GCC installation on the system, and report
76 /// information about it. It starts from the host information provided to the
77 /// Driver, and has logic for fuzzing that where appropriate.
78 class GCCInstallationDetector {
80 llvm::Triple GCCTriple;
82 // FIXME: These might be better as path objects.
83 std::string GCCInstallPath;
84 std::string GCCParentLibPath;
86 /// The primary multilib appropriate for the given flags.
87 Multilib SelectedMultilib;
88 /// On Biarch systems, this corresponds to the default multilib when
89 /// targeting the non-default multilib. Otherwise, it is empty.
90 llvm::Optional<Multilib> BiarchSibling;
94 // We retain the list of install paths that were considered and rejected in
95 // order to print out detailed information in verbose mode.
96 std::set<std::string> CandidateGCCInstallPaths;
98 /// The set of multilibs that the detected installation supports.
99 MultilibSet Multilibs;
102 GCCInstallationDetector() : IsValid(false) {}
103 void init(const Driver &D, const llvm::Triple &TargetTriple,
104 const llvm::opt::ArgList &Args);
106 /// \brief Check whether we detected a valid GCC install.
107 bool isValid() const { return IsValid; }
109 /// \brief Get the GCC triple for the detected install.
110 const llvm::Triple &getTriple() const { return GCCTriple; }
112 /// \brief Get the detected GCC installation path.
113 StringRef getInstallPath() const { return GCCInstallPath; }
115 /// \brief Get the detected GCC parent lib path.
116 StringRef getParentLibPath() const { return GCCParentLibPath; }
118 /// \brief Get the detected Multilib
119 const Multilib &getMultilib() const { return SelectedMultilib; }
121 /// \brief Get the whole MultilibSet
122 const MultilibSet &getMultilibs() const { return Multilibs; }
124 /// Get the biarch sibling multilib (if it exists).
125 /// \return true iff such a sibling exists
126 bool getBiarchSibling(Multilib &M) const;
128 /// \brief Get the detected GCC version string.
129 const GCCVersion &getVersion() const { return Version; }
131 /// \brief Print information about the detected GCC installation.
132 void print(raw_ostream &OS) const;
136 CollectLibDirsAndTriples(const llvm::Triple &TargetTriple,
137 const llvm::Triple &BiarchTriple,
138 SmallVectorImpl<StringRef> &LibDirs,
139 SmallVectorImpl<StringRef> &TripleAliases,
140 SmallVectorImpl<StringRef> &BiarchLibDirs,
141 SmallVectorImpl<StringRef> &BiarchTripleAliases);
143 void ScanLibDirForGCCTriple(const llvm::Triple &TargetArch,
144 const llvm::opt::ArgList &Args,
145 const std::string &LibDir,
146 StringRef CandidateTriple,
147 bool NeedsBiarchSuffix = false);
150 GCCInstallationDetector GCCInstallation;
153 Generic_GCC(const Driver &D, const llvm::Triple &Triple,
154 const llvm::opt::ArgList &Args);
157 void printVerboseInfo(raw_ostream &OS) const override;
159 bool IsUnwindTablesDefault() const override;
160 bool isPICDefault() const override;
161 bool isPIEDefault() const override;
162 bool isPICDefaultForced() const override;
163 bool IsIntegratedAssemblerDefault() const override;
166 Tool *getTool(Action::ActionClass AC) const override;
167 Tool *buildAssembler() const override;
168 Tool *buildLinker() const override;
170 /// \name ToolChain Implementation Helper Functions
173 /// \brief Check whether the target triple's architecture is 64-bits.
174 bool isTarget64Bit() const { return getTriple().isArch64Bit(); }
176 /// \brief Check whether the target triple's architecture is 32-bits.
177 bool isTarget32Bit() const { return getTriple().isArch32Bit(); }
182 mutable std::unique_ptr<tools::gcc::Preprocess> Preprocess;
183 mutable std::unique_ptr<tools::gcc::Compile> Compile;
186 class LLVM_LIBRARY_VISIBILITY MachO : public ToolChain {
188 Tool *buildAssembler() const override;
189 Tool *buildLinker() const override;
190 Tool *getTool(Action::ActionClass AC) const override;
192 mutable std::unique_ptr<tools::darwin::Lipo> Lipo;
193 mutable std::unique_ptr<tools::darwin::Dsymutil> Dsymutil;
194 mutable std::unique_ptr<tools::darwin::VerifyDebug> VerifyDebug;
197 MachO(const Driver &D, const llvm::Triple &Triple,
198 const llvm::opt::ArgList &Args);
201 /// @name MachO specific toolchain API
204 /// Get the "MachO" arch name for a particular compiler invocation. For
205 /// example, Apple treats different ARM variations as distinct architectures.
206 StringRef getMachOArchName(const llvm::opt::ArgList &Args) const;
209 /// Add the linker arguments to link the ARC runtime library.
210 virtual void AddLinkARCArgs(const llvm::opt::ArgList &Args,
211 llvm::opt::ArgStringList &CmdArgs) const {}
213 /// Add the linker arguments to link the compiler runtime library.
214 virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
215 llvm::opt::ArgStringList &CmdArgs) const;
218 addStartObjectFileArgs(const llvm::opt::ArgList &Args,
219 llvm::opt::ArgStringList &CmdArgs) const {}
221 virtual void addMinVersionArgs(const llvm::opt::ArgList &Args,
222 llvm::opt::ArgStringList &CmdArgs) const {}
224 /// On some iOS platforms, kernel and kernel modules were built statically. Is
225 /// this such a target?
226 virtual bool isKernelStatic() const {
230 /// Is the target either iOS or an iOS simulator?
231 bool isTargetIOSBased() const {
235 void AddLinkRuntimeLib(const llvm::opt::ArgList &Args,
236 llvm::opt::ArgStringList &CmdArgs,
237 StringRef DarwinStaticLib,
238 bool AlwaysLink = false,
239 bool IsEmbedded = false) const;
242 /// @name ToolChain Implementation
245 std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
246 types::ID InputType) const override;
248 types::ID LookupTypeForExtension(const char *Ext) const override;
250 bool HasNativeLLVMSupport() const override;
252 llvm::opt::DerivedArgList *
253 TranslateArgs(const llvm::opt::DerivedArgList &Args,
254 const char *BoundArch) const override;
256 bool IsBlocksDefault() const override {
257 // Always allow blocks on Apple; users interested in versioning are
258 // expected to use /usr/include/Blocks.h.
261 bool IsIntegratedAssemblerDefault() const override {
262 // Default integrated assembler to on for Apple's MachO targets.
266 bool IsMathErrnoDefault() const override {
270 bool IsEncodeExtendedBlockSignatureDefault() const override {
274 bool IsObjCNonFragileABIDefault() const override {
275 // Non-fragile ABI is default for everything but i386.
276 return getTriple().getArch() != llvm::Triple::x86;
279 bool UseObjCMixedDispatch() const override {
283 bool IsUnwindTablesDefault() const override;
285 RuntimeLibType GetDefaultRuntimeLibType() const override {
286 return ToolChain::RLT_CompilerRT;
289 bool isPICDefault() const override;
290 bool isPIEDefault() const override;
291 bool isPICDefaultForced() const override;
293 bool SupportsProfiling() const override;
295 bool SupportsObjCGC() const override {
299 bool UseDwarfDebugFlags() const override;
301 bool UseSjLjExceptions() const override {
308 /// Darwin - The base Darwin tool chain.
309 class LLVM_LIBRARY_VISIBILITY Darwin : public MachO {
311 /// The host version.
312 unsigned DarwinVersion[3];
314 /// Whether the information on the target has been initialized.
316 // FIXME: This should be eliminated. What we want to do is make this part of
317 // the "default target for arguments" selection process, once we get out of
318 // the argument translation business.
319 mutable bool TargetInitialized;
321 enum DarwinPlatformKind {
327 mutable DarwinPlatformKind TargetPlatform;
329 /// The OS version we are targeting.
330 mutable VersionTuple TargetVersion;
333 /// The default macosx-version-min of this tool chain; empty until
335 std::string MacosxVersionMin;
337 /// The default ios-version-min of this tool chain; empty until
339 std::string iOSVersionMin;
342 void AddDeploymentTarget(llvm::opt::DerivedArgList &Args) const;
345 Darwin(const Driver &D, const llvm::Triple &Triple,
346 const llvm::opt::ArgList &Args);
349 std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
350 types::ID InputType) const override;
352 /// @name Apple Specific Toolchain Implementation
356 addMinVersionArgs(const llvm::opt::ArgList &Args,
357 llvm::opt::ArgStringList &CmdArgs) const override;
360 addStartObjectFileArgs(const llvm::opt::ArgList &Args,
361 llvm::opt::ArgStringList &CmdArgs) const override;
363 bool isKernelStatic() const override {
364 return !isTargetIPhoneOS() || isIPhoneOSVersionLT(6, 0) ||
365 getTriple().getArch() == llvm::Triple::arm64;
370 /// @name Darwin specific Toolchain functions
373 // FIXME: Eliminate these ...Target functions and derive separate tool chains
374 // for these targets and put version in constructor.
375 void setTarget(DarwinPlatformKind Platform, unsigned Major, unsigned Minor,
376 unsigned Micro) const {
377 // FIXME: For now, allow reinitialization as long as values don't
378 // change. This will go away when we move away from argument translation.
379 if (TargetInitialized && TargetPlatform == Platform &&
380 TargetVersion == VersionTuple(Major, Minor, Micro))
383 assert(!TargetInitialized && "Target already initialized!");
384 TargetInitialized = true;
385 TargetPlatform = Platform;
386 TargetVersion = VersionTuple(Major, Minor, Micro);
389 bool isTargetIPhoneOS() const {
390 assert(TargetInitialized && "Target not initialized!");
391 return TargetPlatform == IPhoneOS;
394 bool isTargetIOSSimulator() const {
395 assert(TargetInitialized && "Target not initialized!");
396 return TargetPlatform == IPhoneOSSimulator;
399 bool isTargetIOSBased() const {
400 assert(TargetInitialized && "Target not initialized!");
401 return isTargetIPhoneOS() || isTargetIOSSimulator();
404 bool isTargetMacOS() const {
405 return TargetPlatform == MacOS;
408 bool isTargetInitialized() const { return TargetInitialized; }
410 VersionTuple getTargetVersion() const {
411 assert(TargetInitialized && "Target not initialized!");
412 return TargetVersion;
415 bool isIPhoneOSVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
416 assert(isTargetIOSBased() && "Unexpected call for non iOS target!");
417 return TargetVersion < VersionTuple(V0, V1, V2);
420 bool isMacosxVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
421 assert(isTargetMacOS() && "Unexpected call for non OS X target!");
422 return TargetVersion < VersionTuple(V0, V1, V2);
427 /// @name ToolChain Implementation
430 // Darwin tools support multiple architecture (e.g., i386 and x86_64) and
431 // most development is done against SDKs, so compiling for a different
432 // architecture should not get any special treatment.
433 bool isCrossCompiling() const override { return false; }
435 llvm::opt::DerivedArgList *
436 TranslateArgs(const llvm::opt::DerivedArgList &Args,
437 const char *BoundArch) const override;
439 ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const override;
440 bool hasBlocksRuntime() const override;
442 bool UseObjCMixedDispatch() const override {
443 // This is only used with the non-fragile ABI and non-legacy dispatch.
445 // Mixed dispatch is used everywhere except OS X before 10.6.
446 return !(isTargetMacOS() && isMacosxVersionLT(10, 6));
449 unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
450 // Stack protectors default to on for user code on 10.5,
451 // and for everything in 10.6 and beyond
452 if (isTargetIOSBased())
454 else if (isTargetMacOS() && !isMacosxVersionLT(10, 6))
456 else if (isTargetMacOS() && !isMacosxVersionLT(10, 5) && !KernelOrKext)
462 bool SupportsObjCGC() const override;
464 void CheckObjCARC() const override;
466 bool UseSjLjExceptions() const override;
469 /// DarwinClang - The Darwin toolchain used by Clang.
470 class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin {
472 DarwinClang(const Driver &D, const llvm::Triple &Triple,
473 const llvm::opt::ArgList &Args);
475 /// @name Apple ToolChain Implementation
479 AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
480 llvm::opt::ArgStringList &CmdArgs) const override;
483 AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
484 llvm::opt::ArgStringList &CmdArgs) const override;
487 AddCCKextLibArgs(const llvm::opt::ArgList &Args,
488 llvm::opt::ArgStringList &CmdArgs) const override;
490 virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const;
493 AddLinkARCArgs(const llvm::opt::ArgList &Args,
494 llvm::opt::ArgStringList &CmdArgs) const override;
498 class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Generic_GCC {
499 virtual void anchor();
501 Generic_ELF(const Driver &D, const llvm::Triple &Triple,
502 const llvm::opt::ArgList &Args)
503 : Generic_GCC(D, Triple, Args) {}
505 void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
506 llvm::opt::ArgStringList &CC1Args) const override;
509 class LLVM_LIBRARY_VISIBILITY AuroraUX : public Generic_GCC {
511 AuroraUX(const Driver &D, const llvm::Triple &Triple,
512 const llvm::opt::ArgList &Args);
515 Tool *buildAssembler() const override;
516 Tool *buildLinker() const override;
519 class LLVM_LIBRARY_VISIBILITY Solaris : public Generic_GCC {
521 Solaris(const Driver &D, const llvm::Triple &Triple,
522 const llvm::opt::ArgList &Args);
524 bool IsIntegratedAssemblerDefault() const override { return true; }
526 Tool *buildAssembler() const override;
527 Tool *buildLinker() const override;
532 class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
534 OpenBSD(const Driver &D, const llvm::Triple &Triple,
535 const llvm::opt::ArgList &Args);
537 bool IsMathErrnoDefault() const override { return false; }
538 bool IsObjCNonFragileABIDefault() const override { return true; }
539 bool isPIEDefault() const override { return true; }
541 unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
545 virtual bool IsIntegratedAssemblerDefault() const override {
546 if (getTriple().getArch() == llvm::Triple::ppc ||
547 getTriple().getArch() == llvm::Triple::sparc ||
548 getTriple().getArch() == llvm::Triple::sparcv9)
550 return Generic_ELF::IsIntegratedAssemblerDefault();
554 Tool *buildAssembler() const override;
555 Tool *buildLinker() const override;
558 class LLVM_LIBRARY_VISIBILITY Bitrig : public Generic_ELF {
560 Bitrig(const Driver &D, const llvm::Triple &Triple,
561 const llvm::opt::ArgList &Args);
563 bool IsMathErrnoDefault() const override { return false; }
564 bool IsObjCNonFragileABIDefault() const override { return true; }
566 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
568 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
569 llvm::opt::ArgStringList &CC1Args) const override;
570 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
571 llvm::opt::ArgStringList &CmdArgs) const override;
572 unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
577 Tool *buildAssembler() const override;
578 Tool *buildLinker() const override;
581 class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
583 FreeBSD(const Driver &D, const llvm::Triple &Triple,
584 const llvm::opt::ArgList &Args);
585 bool HasNativeLLVMSupport() const override;
587 bool IsMathErrnoDefault() const override { return false; }
588 bool IsObjCNonFragileABIDefault() const override { return true; }
590 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
592 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
593 llvm::opt::ArgStringList &CC1Args) const override;
594 bool IsIntegratedAssemblerDefault() const override {
595 if (getTriple().getArch() == llvm::Triple::ppc ||
596 getTriple().getArch() == llvm::Triple::ppc64)
598 return Generic_ELF::IsIntegratedAssemblerDefault();
601 bool UseSjLjExceptions() const override;
602 bool isPIEDefault() const override;
604 Tool *buildAssembler() const override;
605 Tool *buildLinker() const override;
608 class LLVM_LIBRARY_VISIBILITY NetBSD : public Generic_ELF {
610 NetBSD(const Driver &D, const llvm::Triple &Triple,
611 const llvm::opt::ArgList &Args);
613 bool IsMathErrnoDefault() const override { return false; }
614 bool IsObjCNonFragileABIDefault() const override { return true; }
616 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
619 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
620 llvm::opt::ArgStringList &CC1Args) const override;
621 bool IsUnwindTablesDefault() const override {
624 bool IsIntegratedAssemblerDefault() const override {
625 if (getTriple().getArch() == llvm::Triple::ppc)
627 return Generic_ELF::IsIntegratedAssemblerDefault();
631 Tool *buildAssembler() const override;
632 Tool *buildLinker() const override;
635 class LLVM_LIBRARY_VISIBILITY Minix : public Generic_ELF {
637 Minix(const Driver &D, const llvm::Triple &Triple,
638 const llvm::opt::ArgList &Args);
641 Tool *buildAssembler() const override;
642 Tool *buildLinker() const override;
645 class LLVM_LIBRARY_VISIBILITY DragonFly : public Generic_ELF {
647 DragonFly(const Driver &D, const llvm::Triple &Triple,
648 const llvm::opt::ArgList &Args);
650 bool IsMathErrnoDefault() const override { return false; }
653 Tool *buildAssembler() const override;
654 Tool *buildLinker() const override;
657 class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF {
659 Linux(const Driver &D, const llvm::Triple &Triple,
660 const llvm::opt::ArgList &Args);
662 bool HasNativeLLVMSupport() const override;
665 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
666 llvm::opt::ArgStringList &CC1Args) const override;
668 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
669 llvm::opt::ArgStringList &CC1Args) const override;
670 bool isPIEDefault() const override;
673 std::vector<std::string> ExtraOpts;
676 Tool *buildAssembler() const override;
677 Tool *buildLinker() const override;
680 static bool addLibStdCXXIncludePaths(Twine Base, Twine Suffix,
682 StringRef GCCMultiarchTriple,
683 StringRef TargetMultiarchTriple,
685 const llvm::opt::ArgList &DriverArgs,
686 llvm::opt::ArgStringList &CC1Args);
688 std::string computeSysRoot() const;
691 class LLVM_LIBRARY_VISIBILITY Hexagon_TC : public Linux {
693 GCCVersion GCCLibAndIncVersion;
694 Tool *buildAssembler() const override;
695 Tool *buildLinker() const override;
698 Hexagon_TC(const Driver &D, const llvm::Triple &Triple,
699 const llvm::opt::ArgList &Args);
703 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
704 llvm::opt::ArgStringList &CC1Args) const override;
706 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
707 llvm::opt::ArgStringList &CC1Args) const override;
708 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
710 StringRef GetGCCLibAndIncVersion() const { return GCCLibAndIncVersion.Text; }
712 static std::string GetGnuDir(const std::string &InstalledDir);
714 static StringRef GetTargetCPU(const llvm::opt::ArgList &Args);
717 /// TCEToolChain - A tool chain using the llvm bitcode tools to perform
718 /// all subcommands. See http://tce.cs.tut.fi for our peculiar target.
719 class LLVM_LIBRARY_VISIBILITY TCEToolChain : public ToolChain {
721 TCEToolChain(const Driver &D, const llvm::Triple &Triple,
722 const llvm::opt::ArgList &Args);
725 bool IsMathErrnoDefault() const override;
726 bool isPICDefault() const override;
727 bool isPIEDefault() const override;
728 bool isPICDefaultForced() const override;
731 class LLVM_LIBRARY_VISIBILITY Windows : public ToolChain {
733 Windows(const Driver &D, const llvm::Triple &Triple,
734 const llvm::opt::ArgList &Args);
736 bool IsIntegratedAssemblerDefault() const override;
737 bool IsUnwindTablesDefault() const override;
738 bool isPICDefault() const override;
739 bool isPIEDefault() const override;
740 bool isPICDefaultForced() const override;
743 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
744 llvm::opt::ArgStringList &CC1Args) const override;
746 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
747 llvm::opt::ArgStringList &CC1Args) const override;
750 Tool *buildLinker() const override;
751 Tool *buildAssembler() const override;
755 class LLVM_LIBRARY_VISIBILITY XCore : public ToolChain {
757 XCore(const Driver &D, const llvm::Triple &Triple,
758 const llvm::opt::ArgList &Args);
760 Tool *buildAssembler() const override;
761 Tool *buildLinker() const override;
763 bool isPICDefault() const override;
764 bool isPIEDefault() const override;
765 bool isPICDefaultForced() const override;
766 bool SupportsProfiling() const override;
767 bool hasBlocksRuntime() const override;
768 void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
769 llvm::opt::ArgStringList &CC1Args) const override;
770 void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
771 llvm::opt::ArgStringList &CC1Args) const override;
772 void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
773 llvm::opt::ArgStringList &CC1Args) const override;
774 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
775 llvm::opt::ArgStringList &CmdArgs) const override;
778 } // end namespace toolchains
779 } // end namespace driver
780 } // end namespace clang