summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/SanitizerMetadata.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-11-07 22:29:38 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-11-07 22:29:38 +0000
commitedf99a92c00193fb72f3e94f4440b9f86789cca4 (patch)
tree38223e591da34506e9f12ad46d6fcf7fc985cd61 /clang/lib/CodeGen/SanitizerMetadata.cpp
parentea0a4dfd2764d4b57366e104477467723c1acb4c (diff)
downloadbcm5719-llvm-edf99a92c00193fb72f3e94f4440b9f86789cca4.tar.gz
bcm5719-llvm-edf99a92c00193fb72f3e94f4440b9f86789cca4.zip
Introduce a SanitizerKind enum to LangOptions.
Use the bitmask to store the set of enabled sanitizers instead of a bitfield. On the negative side, it makes syntax for querying the set of enabled sanitizers a bit more clunky. On the positive side, we will be able to use SanitizerKind to eventually implement the new semantics for -fsanitize-recover= flag, that would allow us to make some sanitizers recoverable, and some non-recoverable. No functionality change. llvm-svn: 221558
Diffstat (limited to 'clang/lib/CodeGen/SanitizerMetadata.cpp')
-rw-r--r--clang/lib/CodeGen/SanitizerMetadata.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/SanitizerMetadata.cpp b/clang/lib/CodeGen/SanitizerMetadata.cpp
index 7516dd03369..70bc0581a5b 100644
--- a/clang/lib/CodeGen/SanitizerMetadata.cpp
+++ b/clang/lib/CodeGen/SanitizerMetadata.cpp
@@ -25,7 +25,7 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
SourceLocation Loc, StringRef Name,
QualType Ty, bool IsDynInit,
bool IsBlacklisted) {
- if (!CGM.getLangOpts().Sanitize.Address)
+ if (!CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
return;
IsDynInit &= !CGM.isInSanitizerBlacklist(GV, Loc, Ty, "init");
IsBlacklisted |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
@@ -54,7 +54,7 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
const VarDecl &D, bool IsDynInit) {
- if (!CGM.getLangOpts().Sanitize.Address)
+ if (!CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
return;
std::string QualName;
llvm::raw_string_ostream OS(QualName);
@@ -65,7 +65,7 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {
// For now, just make sure the global is not modified by the ASan
// instrumentation.
- if (CGM.getLangOpts().Sanitize.Address)
+ if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
reportGlobalToASan(GV, SourceLocation(), "", QualType(), false, true);
}
OpenPOWER on IntegriCloud