From 4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9 Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Thu, 27 May 2021 18:24:21 +0200 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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; -- cgit v1.1