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:
Richard Smith 2012-11-05 21:48:12 +00:00
parent 856ffa6677
commit 43f9d9c6d9
7 changed files with 12 additions and 12 deletions

View File

@ -127,8 +127,8 @@ BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype")
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(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")
BENIGN_LANGOPT(AddressSanitizer , 1, 0, "AddressSanitizer enabled")
BENIGN_LANGOPT(ThreadSanitizer , 1, 0, "ThreadSanitizer enabled")
BENIGN_LANGOPT(SanitizeAddress , 1, 0, "AddressSanitizer enabled")
BENIGN_LANGOPT(SanitizeThread , 1, 0, "ThreadSanitizer enabled")
BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")

View File

@ -94,7 +94,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
Builder.defineMacro("OBJC_NEW_PROPERTIES");
// AddressSanitizer doesn't play well with source fortification, which is on
// by default on Darwin.
if (Opts.AddressSanitizer) Builder.defineMacro("_FORTIFY_SOURCE", "0");
if (Opts.SanitizeAddress) Builder.defineMacro("_FORTIFY_SOURCE", "0");
if (!Opts.ObjCAutoRefCount) {
// __weak is always defined, for use in blocks and with objc pointers.

View File

@ -205,14 +205,14 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
addBoundsCheckingPass);
}
if (LangOpts.AddressSanitizer) {
if (LangOpts.SanitizeAddress) {
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
addAddressSanitizerPass);
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
addAddressSanitizerPass);
}
if (LangOpts.ThreadSanitizer) {
if (LangOpts.SanitizeThread) {
PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
addThreadSanitizerPass);
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,

View File

@ -231,7 +231,7 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
if (!CGM.getLangOpts().Exceptions)
Fn->setDoesNotThrow();
if (CGM.getLangOpts().AddressSanitizer)
if (CGM.getLangOpts().SanitizeAddress)
Fn->addFnAttr(llvm::Attributes::AddressSafety);
return Fn;

View File

@ -103,7 +103,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
createCUDARuntime();
// Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at O0.
if (LangOpts.ThreadSanitizer ||
if (LangOpts.SanitizeThread ||
(!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
TBAA = new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(),
ABI.getMangleContext());
@ -598,7 +598,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
F->addFnAttr(llvm::Attributes::StackProtectReq);
if (LangOpts.AddressSanitizer) {
if (LangOpts.SanitizeAddress) {
// When AddressSanitizer is enabled, set AddressSafety attribute
// unless __attribute__((no_address_safety_analysis)) is used.
if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
@ -1739,7 +1739,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
// If we are compiling with ASan, add metadata indicating dynamically
// initialized globals.
if (LangOpts.AddressSanitizer && NeedsGlobalCtor) {
if (LangOpts.SanitizeAddress && NeedsGlobalCtor) {
llvm::Module &M = getModule();
llvm::NamedMDNode *DynamicInitializers =

View File

@ -1234,8 +1234,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
Opts.AddressSanitizer = Args.hasArg(OPT_faddress_sanitizer);
Opts.ThreadSanitizer = Args.hasArg(OPT_fthread_sanitizer);
Opts.SanitizeAddress = Args.hasArg(OPT_faddress_sanitizer);
Opts.SanitizeThread = Args.hasArg(OPT_fthread_sanitizer);
Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);

View File

@ -745,7 +745,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
Feature = Feature.substr(2, Feature.size() - 4);
return llvm::StringSwitch<bool>(Feature)
.Case("address_sanitizer", LangOpts.AddressSanitizer)
.Case("address_sanitizer", LangOpts.SanitizeAddress)
.Case("attribute_analyzer_noreturn", true)
.Case("attribute_availability", true)
.Case("attribute_availability_with_message", true)