diff options
Diffstat (limited to 'include/clang/Driver/ToolChain.h')
-rw-r--r-- | include/clang/Driver/ToolChain.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index d5f75b8271..4ccf8413ff 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -1,9 +1,8 @@ //===- ToolChain.h - Collections of tools for one platform ------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -100,11 +99,19 @@ public: RLT_Libgcc }; + enum UnwindLibType { + UNW_None, + UNW_CompilerRT, + UNW_Libgcc + }; + enum RTTIMode { RM_Enabled, RM_Disabled, }; + enum FileType { FT_Object, FT_Static, FT_Shared }; + private: friend class RegisterEffectiveTriple; @@ -368,15 +375,19 @@ public: return ToolChain::CST_Libstdcxx; } + virtual UnwindLibType GetDefaultUnwindLibType() const { + return ToolChain::UNW_None; + } + virtual std::string getCompilerRTPath() const; virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component, - bool Shared = false) const; + FileType Type = ToolChain::FT_Static) const; - const char *getCompilerRTArgString(const llvm::opt::ArgList &Args, - StringRef Component, - bool Shared = false) const; + const char * + getCompilerRTArgString(const llvm::opt::ArgList &Args, StringRef Component, + FileType Type = ToolChain::FT_Static) const; // Returns <ResourceDir>/lib/<OSName>/<arch>. This is used by runtimes (such // as OpenMP) to find arch-specific libraries. @@ -401,6 +412,9 @@ public: /// Test whether this toolchain defaults to PIE. virtual bool isPIEDefault() const = 0; + /// Test whether this toolchaind defaults to non-executable stacks. + virtual bool isNoExecStackDefault() const; + /// Tests whether this toolchain forces its default for PIC, PIE or /// non-PIC. If this returns true, any PIC related flags should be ignored /// and instead the results of \c isPICDefault() and \c isPIEDefault() are @@ -512,6 +526,10 @@ public: // given compilation arguments. virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const; + // GetUnwindLibType - Determine the unwind library type to use with the + // given compilation arguments. + virtual UnwindLibType GetUnwindLibType(const llvm::opt::ArgList &Args) const; + /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set /// the include paths to use for the given C++ standard library type. virtual void @@ -564,7 +582,9 @@ public: virtual SanitizerMask getSupportedSanitizers() const; /// Return sanitizers which are enabled by default. - virtual SanitizerMask getDefaultSanitizers() const { return 0; } + virtual SanitizerMask getDefaultSanitizers() const { + return SanitizerMask(); + } }; /// Set a ToolChain's effective triple. Reset it when the registration object |