diff options
| -rw-r--r-- | clang/include/clang/Basic/LangOptions.h | 4 | ||||
| -rw-r--r-- | clang/include/clang/Frontend/CodeGenOptions.h | 3 | ||||
| -rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
5 files changed, 8 insertions, 7 deletions
diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 47a74f06142..f07c6c7d54d 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -30,6 +30,10 @@ struct SanitizerOptions { /// aggressive, 2: more aggressive). unsigned SanitizeAddressFieldPadding : 2; + /// \brief Path to blacklist file specifying which objects + /// (files, functions, variables) should not be instrumented. + std::string BlacklistFile; + /// \brief Cached set of sanitizer options with all sanitizers disabled. static const SanitizerOptions Disabled; }; diff --git a/clang/include/clang/Frontend/CodeGenOptions.h b/clang/include/clang/Frontend/CodeGenOptions.h index aa4b1216b3b..3940384cc13 100644 --- a/clang/include/clang/Frontend/CodeGenOptions.h +++ b/clang/include/clang/Frontend/CodeGenOptions.h @@ -137,9 +137,6 @@ public: /// The thread model to use std::string ThreadModel; - /// Path to blacklist file for sanitizers. - std::string SanitizerBlacklistFile; - /// If not an empty string, trap intrinsics are lowered to calls to this /// function instead of to trap instructions. std::string TrapFuncName; diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 6db952613d2..4f1f52ff6a1 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -214,8 +214,8 @@ static void addDataFlowSanitizerPass(const PassManagerBuilder &Builder, PassManagerBase &PM) { const PassManagerBuilderWrapper &BuilderWrapper = static_cast<const PassManagerBuilderWrapper&>(Builder); - const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createDataFlowSanitizerPass(CGOpts.SanitizerBlacklistFile)); + const LangOptions &LangOpts = BuilderWrapper.getLangOpts(); + PM.add(createDataFlowSanitizerPass(LangOpts.Sanitize.BlacklistFile)); } static TargetLibraryInfo *createTLI(llvm::Triple &TargetTriple, diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 5d314f525cd..587fc139150 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -90,7 +90,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, BlockObjectDispose(nullptr), BlockDescriptorType(nullptr), GenericBlockLiteralType(nullptr), LifetimeStartFn(nullptr), LifetimeEndFn(nullptr), SanitizerBL(llvm::SpecialCaseList::createOrDie( - CGO.SanitizerBlacklistFile)), + LangOpts.Sanitize.BlacklistFile)), SanitizerMD(new SanitizerMetadata(*this)) { // Initialize the type cache. diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 25d444eeb81..19eecdbaedf 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -487,7 +487,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); Opts.LinkBitcodeFile = Args.getLastArgValue(OPT_mlink_bitcode_file); - Opts.SanitizerBlacklistFile = Args.getLastArgValue(OPT_fsanitize_blacklist); Opts.SanitizeMemoryTrackOrigins = getLastArgIntValue(Args, OPT_fsanitize_memory_track_origins_EQ, 0, Diags); Opts.SanitizeUndefinedTrapOnError = @@ -1631,6 +1630,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, // -fsanitize-address-field-padding=N has to be a LangOpt, parse it here. Opts.Sanitize.SanitizeAddressFieldPadding = getLastArgIntValue(Args, OPT_fsanitize_address_field_padding, 0, Diags); + Opts.Sanitize.BlacklistFile = Args.getLastArgValue(OPT_fsanitize_blacklist); } static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, |

