aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/Driver/ToolChain.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Driver/ToolChain.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/Driver/ToolChain.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Driver/ToolChain.h b/contrib/llvm-project/clang/include/clang/Driver/ToolChain.h
index 7495e08fe6e6..28c37a44e1eb 100644
--- a/contrib/llvm-project/clang/include/clang/Driver/ToolChain.h
+++ b/contrib/llvm-project/clang/include/clang/Driver/ToolChain.h
@@ -27,6 +27,7 @@
#include "llvm/Support/VersionTuple.h"
#include "llvm/Target/TargetOptions.h"
#include <cassert>
+#include <climits>
#include <memory>
#include <string>
#include <utility>
@@ -327,7 +328,14 @@ public:
/// Returns the linker path, respecting the -fuse-ld= argument to determine
/// the linker suffix or name.
- std::string GetLinkerPath() const;
+ /// If LinkerIsLLD is non-nullptr, it is set to true if the returned linker
+ /// is LLD. If it's set, it can be assumed that the linker is LLD built
+ /// at the same revision as clang, and clang can make assumptions about
+ /// LLD's supported flags, error output, etc.
+ /// If LinkerIsLLDDarwinNew is non-nullptr, it's set if the linker is
+ /// the new version in lld/MachO.
+ std::string GetLinkerPath(bool *LinkerIsLLD = nullptr,
+ bool *LinkerIsLLDDarwinNew = nullptr) const;
/// Returns the linker path for emitting a static library.
std::string GetStaticLibToolPath() const;
@@ -382,9 +390,10 @@ public:
virtual bool useRelaxRelocations() const;
/// GetDefaultStackProtectorLevel - Get the default stack protector level for
- /// this tool chain (0=off, 1=on, 2=strong, 3=all).
- virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
- return 0;
+ /// this tool chain.
+ virtual LangOptions::StackProtectorMode
+ GetDefaultStackProtectorLevel(bool KernelOrKext) const {
+ return LangOptions::SSPOff;
}
/// Get the default trivial automatic variable initialization.
@@ -419,10 +428,10 @@ public:
getCompilerRTArgString(const llvm::opt::ArgList &Args, StringRef Component,
FileType Type = ToolChain::FT_Static) const;
- std::string getCompilerRTBasename(const llvm::opt::ArgList &Args,
- StringRef Component,
- FileType Type = ToolChain::FT_Static,
- bool AddArch = true) const;
+ virtual std::string
+ getCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component,
+ FileType Type = ToolChain::FT_Static,
+ bool AddArch = true) const;
// Returns target specific runtime path if it exists.
virtual Optional<std::string> getRuntimePath() const;
@@ -435,7 +444,7 @@ public:
std::string getArchSpecificLibPath() const;
// Returns <OSname> part of above.
- StringRef getOSLibName() const;
+ virtual StringRef getOSLibName() const;
/// needsProfileRT - returns true if instrumentation profile is on.
static bool needsProfileRT(const llvm::opt::ArgList &Args);
@@ -481,6 +490,11 @@ public:
// to the contrary.
virtual unsigned GetDefaultDwarfVersion() const { return 4; }
+ // Some toolchains may have different restrictions on the DWARF version and
+ // may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host
+ // compilation uses DWARF5.
+ virtual unsigned getMaxDwarfVersion() const { return UINT_MAX; }
+
// 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.