[MSan] add KMSAN support to Clang driver
authorAlexander Potapenko <glider@google.com>
Fri, 7 Sep 2018 09:21:09 +0000 (09:21 +0000)
committerAlexander Potapenko <glider@google.com>
Fri, 7 Sep 2018 09:21:09 +0000 (09:21 +0000)
commitd49c32ce3f3f87ae7b04c168438a038a632db0c1
tree707484c721249c3c31e89adf6288855bef4c1299
parente5536b972f053d8c30a444e429e2dd39505aa37c
[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
13 files changed:
clang/include/clang/Basic/Features.def
clang/include/clang/Basic/Sanitizers.def
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CGDeclCXX.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/ToolChains/Linux.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/cleanup-destslot-simple.c
clang/test/Driver/fsanitize-coverage.c
clang/test/Driver/fsanitize.c
clang/test/Driver/msan.c
clang/test/Lexer/has_feature_memory_sanitizer.cpp