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 | bbb410ae0caf087b00b1dcf38792485b2ebdac63 (patch) | |
| tree | a384e7194e437a46de1e445f0dca66577317178a /lib/CodeGen/CodeGenFunction.cpp | |
| parent | b6dc2efd4106d7d1a048b670bc1b69220dd4c5fd (diff) | |
| download | clang-bbb410ae0caf087b00b1dcf38792485b2ebdac63.tar.gz | |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index d3b1bd77dc..7a4eedc200 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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); |
