diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 13:34:49 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 13:34:49 +0000 |
commit | 63b24cc778504ffd19e4c30a730e574c346312ee (patch) | |
tree | 28726ef2038e86121e353aabf52297b35a48efa2 /contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h | |
parent | 9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a (diff) | |
parent | 3176e97f130184ece0e1a21352c8124cc83ff24a (diff) | |
download | FreeBSD-src-63b24cc778504ffd19e4c30a730e574c346312ee.zip FreeBSD-src-63b24cc778504ffd19e4c30a730e574c346312ee.tar.gz |
Update clang to trunk r256633.
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h')
-rw-r--r-- | contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h | 72 |
1 files changed, 65 insertions, 7 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h b/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h index aba18c9..ed73107 100644 --- a/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h +++ b/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/Path.h" +#include "llvm/Target/TargetOptions.h" #include <memory> #include <string> @@ -30,7 +31,10 @@ namespace opt { } namespace clang { - class ObjCRuntime; +class ObjCRuntime; +namespace vfs { +class FileSystem; +} namespace driver { class Compilation; @@ -89,6 +93,7 @@ private: protected: MultilibSet Multilibs; + const char *DefaultLinker = "ld"; ToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args); @@ -119,7 +124,8 @@ public: // Accessors - const Driver &getDriver() const; + const Driver &getDriver() const { return D; } + vfs::FileSystem &getVFS() const; const llvm::Triple &getTriple() const { return Triple; } llvm::Triple::ArchType getArch() const { return Triple.getArch(); } @@ -151,6 +157,20 @@ public: // Returns the RTTIMode for the toolchain with the current arguments. RTTIMode getRTTIMode() const { return CachedRTTIMode; } + /// \brief Return any implicit target and/or mode flag for an invocation of + /// the compiler driver as `ProgName`. + /// + /// For example, when called with i686-linux-android-g++, the first element + /// of the return value will be set to `"i686-linux-android"` and the second + /// will be set to "--driver-mode=g++"`. + /// + /// \pre `llvm::InitializeAllTargets()` has been called. + /// \param ProgName The name the Clang driver was invoked with (from, + /// e.g., argv[0]) + /// \return A pair of (`target`, `mode-flag`), where one or both may be empty. + static std::pair<std::string, std::string> + getTargetAndModeFromProgramName(StringRef ProgName); + // Tool access. /// TranslateArgs - Create a new derived argument list for any argument @@ -167,7 +187,7 @@ public: /// Choose a tool to use to handle the action \p JA. /// /// This can be overridden when a particular ToolChain needs to use - /// a C compiler other than Clang. + /// a compiler other than Clang. virtual Tool *SelectTool(const JobAction &JA) const; // Helper methods @@ -184,7 +204,7 @@ public: /// This is used when handling the verbose option to print detailed, /// toolchain-specific information useful for understanding the behavior of /// the driver on a specific platform. - virtual void printVerboseInfo(raw_ostream &OS) const {}; + virtual void printVerboseInfo(raw_ostream &OS) const {} // Platform defaults information @@ -236,6 +256,16 @@ public: return ToolChain::RLT_Libgcc; } + virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, + StringRef Component, + bool Shared = false) const; + + const char *getCompilerRTArgString(const llvm::opt::ArgList &Args, + StringRef Component, + bool Shared = false) const; + /// needsProfileRT - returns true if instrumentation profile is on. + static bool needsProfileRT(const llvm::opt::ArgList &Args); + /// IsUnwindTablesDefault - Does this tool chain use -funwind-tables /// by default. virtual bool IsUnwindTablesDefault() const; @@ -265,8 +295,25 @@ public: /// compile unit information. virtual bool UseDwarfDebugFlags() const { return false; } + // Return the DWARF version to emit, in the absence of arguments + // to the contrary. + virtual unsigned GetDefaultDwarfVersion() const { return 4; } + + // True if the driver should assume "-fstandalone-debug" + // in the absence of an option specifying otherwise, + // provided that debugging was requested in the first place. + // i.e. a value of 'true' does not imply that debugging is wanted. + virtual bool GetDefaultStandaloneDebug() const { return false; } + + // Return the default debugger "tuning." + virtual llvm::DebuggerKind getDefaultDebuggerTuning() const { + return llvm::DebuggerKind::GDB; + } + /// UseSjLjExceptions - Does this tool chain use SjLj exceptions. - virtual bool UseSjLjExceptions() const { return false; } + virtual bool UseSjLjExceptions(const llvm::opt::ArgList &Args) const { + return false; + } /// getThreadModel() - Which thread model does this target use? virtual std::string getThreadModel() const { return "posix"; } @@ -337,6 +384,10 @@ public: virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; + /// AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option. + void AddFilePathLibArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + /// AddCCKextLibArgs - Add the system specific linker arguments to use /// for kernel extensions (Darwin-specific). virtual void AddCCKextLibArgs(const llvm::opt::ArgList &Args, @@ -346,10 +397,17 @@ public: /// global flags for unsafe floating point math, add it and return true. /// /// This checks for presence of the -Ofast, -ffast-math or -funsafe-math flags. - virtual bool - AddFastMathRuntimeIfAvailable(const llvm::opt::ArgList &Args, + virtual bool AddFastMathRuntimeIfAvailable( + const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; + /// addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass + /// a suitable profile runtime library to the linker. + virtual void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; + /// \brief Add arguments to use system-specific CUDA includes. + virtual void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args) const; + /// \brief Return sanitizers which are available in this toolchain. virtual SanitizerMask getSupportedSanitizers() const; }; |