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 | ae5303d01026f392c0f186dd3bc703aeb6b16870 (patch) | |
tree | 2ed637d836dfdb5ef2a11e6dea9253664abbffc8 /clang/lib/CodeGen/CGExpr.cpp | |
parent | afb3398da0fef06e6dc086911fa59027f2c42556 (diff) | |
download | bcm5719-llvm-ae5303d01026f392c0f186dd3bc703aeb6b16870.tar.gz bcm5719-llvm-ae5303d01026f392c0f186dd3bc703aeb6b16870.zip |
[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
llvm-svn: 355190
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 5ee0378efe4..09ba2a0eb71 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -2855,16 +2855,13 @@ enum class CheckRecoverableKind { } static CheckRecoverableKind getRecoverableKind(SanitizerMask Kind) { - assert(llvm::countPopulation(Kind) == 1); - switch (Kind) { - case SanitizerKind::Vptr: + assert(Kind.countPopulation() == 1); + if (Kind == SanitizerKind::Vptr) return CheckRecoverableKind::AlwaysRecoverable; - case SanitizerKind::Return: - case SanitizerKind::Unreachable: + else if (Kind == SanitizerKind::Return || Kind == SanitizerKind::Unreachable) return CheckRecoverableKind::Unrecoverable; - default: + else return CheckRecoverableKind::Recoverable; - } } namespace { |