aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-05-27 18:24:21 +0200
committerMarco Elver <elver@google.com>2021-05-27 18:24:21 +0200
commit4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9 (patch)
treed81f6f654136fe50b84d62d6102533149c388d9f /clang/lib/Frontend/CompilerInvocation.cpp
parentc412979cde54ec3b5d9f3b83f2b8b5b4b353ed65 (diff)
downloadllvm-4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9.zip
llvm-4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9.tar.gz
llvm-4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9.tar.bz2
[Clang] Enable __has_feature(coverage_sanitizer)
Like other sanitizers, enable __has_feature(coverage_sanitizer) if clang has enabled at least one SanitizerCoverage instrumentation type. Because coverage instrumentation selection is not handled via normal -fsanitize= (and thus not in SanitizeSet), passing this information through to LangOptions required propagating the already parsed -fsanitize-coverage= options from CodeGenOptions through to LangOptions in FixupInvocation(). Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D103159
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 809492a..28cd839 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -453,7 +453,7 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
CodeGenOpts.XRayAlwaysEmitTypedEvents = LangOpts.XRayAlwaysEmitTypedEvents;
CodeGenOpts.DisableFree = FrontendOpts.DisableFree;
FrontendOpts.GenerateGlobalModuleIndex = FrontendOpts.UseGlobalModuleIndex;
-
+ LangOpts.SanitizeCoverage = CodeGenOpts.hasSanitizeCoverage();
LangOpts.ForceEmitVTables = CodeGenOpts.ForceEmitVTables;
LangOpts.SpeculativeLoadHardening = CodeGenOpts.SpeculativeLoadHardening;
LangOpts.CurrentModule = LangOpts.ModuleName;