@@ -556,6 +556,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
556556static void InitializePredefinedMacros (const TargetInfo &TI,
557557 const LangOptions &LangOpts,
558558 const FrontendOptions &FEOpts,
559+ const PreprocessorOptions &PPOpts,
559560 MacroBuilder &Builder) {
560561 // Compiler version introspection macros.
561562 Builder.defineMacro (" __llvm__" ); // LLVM Backend
@@ -988,8 +989,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
988989 else if (LangOpts.getStackProtector () == LangOptions::SSPReq)
989990 Builder.defineMacro (" __SSP_ALL__" , " 3" );
990991
991- // Define a macro that exists only when using the static analyzer.
992- if (FEOpts.ProgramAction == frontend::RunAnalysis)
992+ if (PPOpts.SetUpStaticAnalyzer )
993993 Builder.defineMacro (" __clang_analyzer__" );
994994
995995 if (LangOpts.FastRelaxedMath )
@@ -1113,9 +1113,10 @@ void clang::InitializePreprocessor(
11131113 // macros. This is not the right way to handle this.
11141114 if ((LangOpts.CUDA || LangOpts.OpenMPIsDevice ) && PP.getAuxTargetInfo ())
11151115 InitializePredefinedMacros (*PP.getAuxTargetInfo (), LangOpts, FEOpts,
1116- Builder);
1116+ PP. getPreprocessorOpts (), Builder);
11171117
1118- InitializePredefinedMacros (PP.getTargetInfo (), LangOpts, FEOpts, Builder);
1118+ InitializePredefinedMacros (PP.getTargetInfo (), LangOpts, FEOpts,
1119+ PP.getPreprocessorOpts (), Builder);
11191120
11201121 // Install definitions to make Objective-C++ ARC work well with various
11211122 // C++ Standard Library implementations.
0 commit comments