After http://reviews.llvm.org/D5687 is submitted, we will need
SanitizerBlacklist before the CodeGen phase, so make it a LangOpt
(as it will actually affect ABI / class layout).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219842
91177308-0d34-0410-b5e6-
96231b3b80d8
/// 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;
};
/// 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;
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,
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.
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 =
// -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,