diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-18 01:16:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-18 01:16:55 +0000 |
commit | 3dba7ebde4e53e3b6feced891cecd4b045e82780 (patch) | |
tree | 6694e66b6595dfc34d36d8b61d4f783045475065 /clang/lib/Lex/Preprocessor.cpp | |
parent | f2b5ec6ef427d8d4129ac5e78ceb319af60a2f99 (diff) | |
download | bcm5719-llvm-3dba7ebde4e53e3b6feced891cecd4b045e82780.tar.gz bcm5719-llvm-3dba7ebde4e53e3b6feced891cecd4b045e82780.zip |
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
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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__) |