]> granicus.if.org Git - clang/commitdiff
Rename LangOptions members for address sanitizer and thread sanitizer from
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 5 Nov 2012 21:48:12 +0000 (21:48 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 5 Nov 2012 21:48:12 +0000 (21:48 +0000)
*Sanitizer to Sanitize* in preparation for later patches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/LangOptions.def
lib/Basic/Targets.cpp
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Lex/PPMacroExpansion.cpp

index 20e4ca8b89cc6a97d9038a11405719c303e7d0a8..7bce57352ab891f04ca22e66945bcf372d46ddfe 100644 (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")
index eb4bd8582f0ced5a1813f0534bc4ca08005a9879..e52013ef0f30466a082222aad21719b432e790c2 100644 (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.
index ab9d49499da4a6f64fd7a00370011ee7173a5ca3..62f87c983bfa5741fe7e21fb82a1aa1512f39a9a 100644 (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,
index 872cb112525fbbcce869295c6d8ec00bae9f9dd0..4a81d8c9ea73b688cc73f609af4da5f368dc7a35 100644 (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;
index 11991124ee0fa0ef3c978bd9bb82065792f8e457..8975e2f4c0a02cc4799ac9b4261aabc67a9f5073 100644 (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 =
index c6ede1b94c0b81dd7f246cc7ba0e33d2dc7f9e94..703b9e7ff229b9beed813c3a1a2f867a1ce426cf 100644 (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);
 
index 06b39d3fa715aeae613ab1da581109c261f31fb0..eee4342e27ca95a4ad07867d10d1fd2634bd0dbc 100644 (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)