diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 5e5011b7f6..a52d1f2751 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -49,7 +49,8 @@ PrintingPolicy Sema::getPrintingPolicy(const ASTContext &Context, PrintingPolicy Policy = Context.getPrintingPolicy(); Policy.Bool = Context.getLangOpts().Bool; if (!Policy.Bool) { - if (MacroInfo *BoolMacro = PP.getMacroInfo(&Context.Idents.get("bool"))) { + if (const MacroInfo * + BoolMacro = PP.getMacroInfo(&Context.Idents.get("bool"))) { Policy.Bool = BoolMacro->isObjectLike() && BoolMacro->getNumTokens() == 1 && BoolMacro->getReplacementToken(0).is(tok::kw__Bool); diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index f894a0ba27..2cc7b85a7f 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2552,8 +2552,9 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, } if (Kind == RK_Macro) { - MacroInfo *MI = PP.getMacroInfoHistory(Macro); - assert(MI && "Not a macro?"); + const MacroDirective *MD = PP.getMacroDirectiveHistory(Macro); + assert(MD && "Not a macro?"); + const MacroInfo *MI = MD->getInfo(); Result.AddTypedTextChunk( Result.getAllocator().CopyString(Macro->getName())); |