Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches. llvm-svn: 167405
This commit is contained in:
@@ -127,8 +127,8 @@ BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype")
|
|||||||
BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
|
BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
|
||||||
BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
|
BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
|
||||||
BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")
|
BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")
|
||||||
BENIGN_LANGOPT(AddressSanitizer , 1, 0, "AddressSanitizer enabled")
|
BENIGN_LANGOPT(SanitizeAddress , 1, 0, "AddressSanitizer enabled")
|
||||||
BENIGN_LANGOPT(ThreadSanitizer , 1, 0, "ThreadSanitizer enabled")
|
BENIGN_LANGOPT(SanitizeThread , 1, 0, "ThreadSanitizer enabled")
|
||||||
|
|
||||||
BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
|
BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
|
||||||
LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
|
LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
|
|||||||
Builder.defineMacro("OBJC_NEW_PROPERTIES");
|
Builder.defineMacro("OBJC_NEW_PROPERTIES");
|
||||||
// AddressSanitizer doesn't play well with source fortification, which is on
|
// AddressSanitizer doesn't play well with source fortification, which is on
|
||||||
// by default on Darwin.
|
// by default on Darwin.
|
||||||
if (Opts.AddressSanitizer) Builder.defineMacro("_FORTIFY_SOURCE", "0");
|
if (Opts.SanitizeAddress) Builder.defineMacro("_FORTIFY_SOURCE", "0");
|
||||||
|
|
||||||
if (!Opts.ObjCAutoRefCount) {
|
if (!Opts.ObjCAutoRefCount) {
|
||||||
// __weak is always defined, for use in blocks and with objc pointers.
|
// __weak is always defined, for use in blocks and with objc pointers.
|
||||||
|
|||||||
@@ -205,14 +205,14 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
|
|||||||
addBoundsCheckingPass);
|
addBoundsCheckingPass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LangOpts.AddressSanitizer) {
|
if (LangOpts.SanitizeAddress) {
|
||||||
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
|
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
|
||||||
addAddressSanitizerPass);
|
addAddressSanitizerPass);
|
||||||
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
|
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
|
||||||
addAddressSanitizerPass);
|
addAddressSanitizerPass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LangOpts.ThreadSanitizer) {
|
if (LangOpts.SanitizeThread) {
|
||||||
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
|
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
|
||||||
addThreadSanitizerPass);
|
addThreadSanitizerPass);
|
||||||
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
|
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
|
|||||||
if (!CGM.getLangOpts().Exceptions)
|
if (!CGM.getLangOpts().Exceptions)
|
||||||
Fn->setDoesNotThrow();
|
Fn->setDoesNotThrow();
|
||||||
|
|
||||||
if (CGM.getLangOpts().AddressSanitizer)
|
if (CGM.getLangOpts().SanitizeAddress)
|
||||||
Fn->addFnAttr(llvm::Attributes::AddressSafety);
|
Fn->addFnAttr(llvm::Attributes::AddressSafety);
|
||||||
|
|
||||||
return Fn;
|
return Fn;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
|
|||||||
createCUDARuntime();
|
createCUDARuntime();
|
||||||
|
|
||||||
// Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at O0.
|
// Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at O0.
|
||||||
if (LangOpts.ThreadSanitizer ||
|
if (LangOpts.SanitizeThread ||
|
||||||
(!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
|
(!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
|
||||||
TBAA = new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(),
|
TBAA = new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(),
|
||||||
ABI.getMangleContext());
|
ABI.getMangleContext());
|
||||||
@@ -598,7 +598,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
|
|||||||
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
|
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
|
||||||
F->addFnAttr(llvm::Attributes::StackProtectReq);
|
F->addFnAttr(llvm::Attributes::StackProtectReq);
|
||||||
|
|
||||||
if (LangOpts.AddressSanitizer) {
|
if (LangOpts.SanitizeAddress) {
|
||||||
// When AddressSanitizer is enabled, set AddressSafety attribute
|
// When AddressSanitizer is enabled, set AddressSafety attribute
|
||||||
// unless __attribute__((no_address_safety_analysis)) is used.
|
// unless __attribute__((no_address_safety_analysis)) is used.
|
||||||
if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
|
if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
|
||||||
@@ -1739,7 +1739,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
|
|||||||
|
|
||||||
// If we are compiling with ASan, add metadata indicating dynamically
|
// If we are compiling with ASan, add metadata indicating dynamically
|
||||||
// initialized globals.
|
// initialized globals.
|
||||||
if (LangOpts.AddressSanitizer && NeedsGlobalCtor) {
|
if (LangOpts.SanitizeAddress && NeedsGlobalCtor) {
|
||||||
llvm::Module &M = getModule();
|
llvm::Module &M = getModule();
|
||||||
|
|
||||||
llvm::NamedMDNode *DynamicInitializers =
|
llvm::NamedMDNode *DynamicInitializers =
|
||||||
|
|||||||
@@ -1234,8 +1234,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
|||||||
Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
|
Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
|
||||||
Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
|
Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
|
||||||
Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
|
Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
|
||||||
Opts.AddressSanitizer = Args.hasArg(OPT_faddress_sanitizer);
|
Opts.SanitizeAddress = Args.hasArg(OPT_faddress_sanitizer);
|
||||||
Opts.ThreadSanitizer = Args.hasArg(OPT_fthread_sanitizer);
|
Opts.SanitizeThread = Args.hasArg(OPT_fthread_sanitizer);
|
||||||
Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
|
Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
|
||||||
Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
|
Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
|
||||||
|
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
|
|||||||
Feature = Feature.substr(2, Feature.size() - 4);
|
Feature = Feature.substr(2, Feature.size() - 4);
|
||||||
|
|
||||||
return llvm::StringSwitch<bool>(Feature)
|
return llvm::StringSwitch<bool>(Feature)
|
||||||
.Case("address_sanitizer", LangOpts.AddressSanitizer)
|
.Case("address_sanitizer", LangOpts.SanitizeAddress)
|
||||||
.Case("attribute_analyzer_noreturn", true)
|
.Case("attribute_analyzer_noreturn", true)
|
||||||
.Case("attribute_availability", true)
|
.Case("attribute_availability", true)
|
||||||
.Case("attribute_availability_with_message", true)
|
.Case("attribute_availability_with_message", true)
|
||||||
|
|||||||
Reference in New Issue
Block a user