diff options
| author | Pierre Gousseau <pierregousseau14@gmail.com> | 2019-03-01 10:05:15 +0000 |
|---|---|---|
| committer | Pierre Gousseau <pierregousseau14@gmail.com> | 2019-03-01 10:05:15 +0000 |
| commit | 1eca87b9ff95080cce84b99617a8e05db088cb6a (patch) | |
| tree | 2402bc8ff3085cd6750fbac069799794b6d5dca7 /lib/Driver/ToolChain.cpp | |
| parent | 70f886033a4637e1fb6e4b8ab1fad09a3dcca5a7 (diff) | |
| download | clang-1eca87b9ff95080cce84b99617a8e05db088cb6a.tar.gz | |
[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".
This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot.
Fixes: https://llvm.org/PR39425
Differential Revision: https://reviews.llvm.org/D57914
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChain.cpp')
| -rw-r--r-- | lib/Driver/ToolChain.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index fcf373e9f7..289d47d394 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -818,21 +818,23 @@ SanitizerMask ToolChain::getSupportedSanitizers() const { // Return sanitizers which don't require runtime support and are not // platform dependent. - using namespace SanitizerKind; - - SanitizerMask Res = (Undefined & ~Vptr & ~Function) | (CFI & ~CFIICall) | - CFICastStrict | UnsignedIntegerOverflow | - ImplicitConversion | Nullability | LocalBounds; + SanitizerMask Res = (SanitizerKind::Undefined & ~SanitizerKind::Vptr & + ~SanitizerKind::Function) | + (SanitizerKind::CFI & ~SanitizerKind::CFIICall) | + SanitizerKind::CFICastStrict | + SanitizerKind::UnsignedIntegerOverflow | + SanitizerKind::ImplicitConversion | + SanitizerKind::Nullability | SanitizerKind::LocalBounds; if (getTriple().getArch() == llvm::Triple::x86 || getTriple().getArch() == llvm::Triple::x86_64 || getTriple().getArch() == llvm::Triple::arm || getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::wasm32 || getTriple().getArch() == llvm::Triple::wasm64) - Res |= CFIICall; + Res |= SanitizerKind::CFIICall; if (getTriple().getArch() == llvm::Triple::x86_64 || getTriple().getArch() == llvm::Triple::aarch64) - Res |= ShadowCallStack; + Res |= SanitizerKind::ShadowCallStack; return Res; } |
