diff options
author | Alexander Potapenko <glider@google.com> | 2018-09-07 09:21:09 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2018-09-07 09:21:09 +0000 |
commit | d49c32ce3f3f87ae7b04c168438a038a632db0c1 (patch) | |
tree | 707484c721249c3c31e89adf6288855bef4c1299 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | e5536b972f053d8c30a444e429e2dd39505aa37c (diff) | |
download | bcm5719-llvm-d49c32ce3f3f87ae7b04c168438a038a632db0c1.tar.gz bcm5719-llvm-d49c32ce3f3f87ae7b04c168438a038a632db0c1.zip |
[MSan] add KMSAN support to Clang driver
Boilerplate code for using KMSAN instrumentation in Clang.
We add a new command line flag, -fsanitize=kernel-memory, with a
corresponding SanitizerKind::KernelMemory, which, along with
SanitizerKind::Memory, maps to the memory_sanitizer feature.
KMSAN is only supported on x86_64 Linux.
It's incompatible with other sanitizers, but supports code coverage
instrumentation.
llvm-svn: 341641
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index d3b1bd77dc4..7a4eedc200c 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -868,7 +868,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, Fn->addFnAttr(llvm::Attribute::SanitizeHWAddress); if (SanOpts.has(SanitizerKind::Thread)) Fn->addFnAttr(llvm::Attribute::SanitizeThread); - if (SanOpts.has(SanitizerKind::Memory)) + if (SanOpts.hasOneOf(SanitizerKind::Memory | SanitizerKind::KernelMemory)) Fn->addFnAttr(llvm::Attribute::SanitizeMemory); if (SanOpts.has(SanitizerKind::SafeStack)) Fn->addFnAttr(llvm::Attribute::SafeStack); |