diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 | 
| commit | 3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch) | |
| tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /lib/Driver/ToolChains.h | |
| parent | a0482fa4e7fa27b01184f938097f0666b78016dd (diff) | |
Notes
Diffstat (limited to 'lib/Driver/ToolChains.h')
| -rw-r--r-- | lib/Driver/ToolChains.h | 50 | 
1 files changed, 37 insertions, 13 deletions
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 4bdd00fc2583..d1f15565e6c6 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -42,6 +42,11 @@ public:  /// Darwin - The base Darwin tool chain.  class LLVM_LIBRARY_VISIBILITY Darwin : public ToolChain { +public: +  /// The host version. +  unsigned DarwinVersion[3]; + +private:    mutable llvm::DenseMap<unsigned, Tool*> Tools;    /// Whether the information on the target has been initialized. @@ -61,11 +66,15 @@ class LLVM_LIBRARY_VISIBILITY Darwin : public ToolChain {    /// initialized.    std::string MacosxVersionMin; +private: +  void AddDeploymentTarget(DerivedArgList &Args) const; +  public: -  Darwin(const HostInfo &Host, const llvm::Triple& Triple, -         const unsigned (&DarwinVersion)[3]); +  Darwin(const HostInfo &Host, const llvm::Triple& Triple);    ~Darwin(); +  std::string ComputeEffectiveClangTriple(const ArgList &Args) const; +    /// @name Darwin Specific Toolchain API    /// { @@ -144,17 +153,17 @@ public:    /// @name ToolChain Implementation    /// { +  virtual types::ID LookupTypeForExtension(const char *Ext) const; +    virtual DerivedArgList *TranslateArgs(const DerivedArgList &Args,                                          const char *BoundArch) const;    virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;    virtual bool IsBlocksDefault() const { -    // Blocks default to on for OS X 10.6 and iPhoneOS 3.0 and beyond. -    if (isTargetIPhoneOS()) -      return !isIPhoneOSVersionLT(3); -    else -      return !isMacosxVersionLT(10, 6); +    // Always allow blocks on Darwin; users interested in versioning are +    // expected to use /usr/include/Blocks.h. +    return true;    }    virtual bool IsIntegratedAssemblerDefault() const {  #ifdef DISABLE_DEFAULT_INTEGRATED_ASSEMBLER @@ -201,8 +210,7 @@ public:  /// DarwinClang - The Darwin toolchain used by Clang.  class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin {  public: -  DarwinClang(const HostInfo &Host, const llvm::Triple& Triple, -              const unsigned (&DarwinVersion)[3]); +  DarwinClang(const HostInfo &Host, const llvm::Triple& Triple);    /// @name Darwin ToolChain Implementation    /// { @@ -225,9 +233,7 @@ class LLVM_LIBRARY_VISIBILITY DarwinGCC : public Darwin {    std::string ToolChainDir;  public: -  DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple, -            const unsigned (&DarwinVersion)[3], -            const unsigned (&GCCVersion)[3]); +  DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple);    /// @name Darwin ToolChain Implementation    /// { @@ -247,6 +253,8 @@ public:    Darwin_Generic_GCC(const HostInfo &Host, const llvm::Triple& Triple)      : Generic_GCC(Host, Triple) {} +  std::string ComputeEffectiveClangTriple(const ArgList &Args) const; +    virtual const char *GetDefaultRelocationModel() const { return "pic"; }  }; @@ -266,7 +274,7 @@ public:  class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_GCC {  public: -  FreeBSD(const HostInfo &Host, const llvm::Triple& Triple, bool Lib32); +  FreeBSD(const HostInfo &Host, const llvm::Triple& Triple);    virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;  }; @@ -288,6 +296,8 @@ public:  class LLVM_LIBRARY_VISIBILITY Linux : public Generic_GCC {  public:    Linux(const HostInfo &Host, const llvm::Triple& Triple); + +  virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;  }; @@ -309,6 +319,20 @@ private:  }; +class LLVM_LIBRARY_VISIBILITY Windows : public ToolChain { +  mutable llvm::DenseMap<unsigned, Tool*> Tools; + +public: +  Windows(const HostInfo &Host, const llvm::Triple& Triple); + +  virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; + +  virtual bool IsIntegratedAssemblerDefault() const; +  virtual bool IsUnwindTablesDefault() const; +  virtual const char *GetDefaultRelocationModel() const; +  virtual const char *GetForcedPicModel() const; +}; +  } // end namespace toolchains  } // end namespace driver  } // end namespace clang  | 
