From 3dba7ebde4e53e3b6feced891cecd4b045e82780 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 18 Aug 2016 01:16:55 +0000 Subject: PR28438: Update the information on an identifier with local definitions before trying to write out its macro graph, in case we imported a module that added another module macro between the most recent local definition and the end of the module. llvm-svn: 279024 --- clang/lib/Lex/Preprocessor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/lib/Lex/Preprocessor.cpp') diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index f0d68725462..73039373824 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -618,6 +618,11 @@ static diag::kind getFutureCompatDiagKind(const IdentifierInfo &II, "Keyword not known to come from a newer Standard or proposed Standard"); } +void Preprocessor::updateOutOfDateIdentifier(IdentifierInfo &II) const { + assert(II.isOutOfDate() && "not out of date"); + getExternalSource()->updateOutOfDateIdentifier(II); +} + /// HandleIdentifier - This callback is invoked when the lexer reads an /// identifier. This callback looks up the identifier in the map and/or /// potentially macro expands it or turns it into a named token (like 'for'). @@ -642,7 +647,7 @@ bool Preprocessor::HandleIdentifier(Token &Identifier) { if (&II == Ident__VA_ARGS__) CurrentIsPoisoned = Ident__VA_ARGS__->isPoisoned(); - ExternalSource->updateOutOfDateIdentifier(II); + updateOutOfDateIdentifier(II); Identifier.setKind(II.getTokenID()); if (&II == Ident__VA_ARGS__) -- cgit v1.2.3