From: Daniel Dunbar Date: Fri, 17 Sep 2010 00:24:52 +0000 (+0000) Subject: Driver: Add a toolchain hook for whether the system has native LLVM support. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b993f5d93b994b9b0aac6aebae669621744bbed7;p=clang Driver: Add a toolchain hook for whether the system has native LLVM support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114137 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index a9de09c9d5..eed1cd6b3c 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -98,6 +98,10 @@ public: // Platform defaults information + /// HasNativeLTOLinker - Check whether the linker and related tools have + /// native LLVM support. + virtual bool HasNativeLLVMSupport() const; + /// LookupTypeForExtension - Return the default language type to use for the /// given extension. virtual types::ID LookupTypeForExtension(const char *Ext) const; diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 337ea4e8f9..e9a612c4cd 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -43,6 +43,10 @@ types::ID ToolChain::LookupTypeForExtension(const char *Ext) const { return types::lookupTypeForExtension(Ext); } +bool ToolChain::HasNativeLLVMSupport() const { + return false; +} + /// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targetting. // // FIXME: tblgen this. diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 471c47dd2b..f5b45595fd 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -59,6 +59,10 @@ types::ID Darwin::LookupTypeForExtension(const char *Ext) const { return Ty; } +bool Darwin::HasNativeLLVMSupport() const { + return true; +} + // FIXME: Can we tablegen this? static const char *GetArmArchForMArch(llvm::StringRef Value) { if (Value == "armv6k") diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index d1f15565e6..587bf60de8 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -155,6 +155,8 @@ public: virtual types::ID LookupTypeForExtension(const char *Ext) const; + virtual bool HasNativeLLVMSupport() const; + virtual DerivedArgList *TranslateArgs(const DerivedArgList &Args, const char *BoundArch) const;