From: Sean Callanan Date: Sat, 14 May 2016 06:24:14 +0000 (+0000) Subject: Update identifiers as needed when loading macros from serialized ASTs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43f3c2698df5a8ecd2efe4e039d5b29b0b47125d;p=clang Update identifiers as needed when loading macros from serialized ASTs. This is essential for iterating across macros properly, which LLDB does when loading macros from modules. A naiver version of this patch (without the conditional) caused assertion failures in the testsuite, but this version should be safe. Thanks to Ben Langmuir for the refinement that made this work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269554 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 0f4a7d3266..8650ce7576 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1680,9 +1680,12 @@ void ASTReader::ReadDefinedMacros() { break; case PP_MACRO_OBJECT_LIKE: - case PP_MACRO_FUNCTION_LIKE: - getLocalIdentifier(*I, Record[0]); + case PP_MACRO_FUNCTION_LIKE: { + IdentifierInfo *II = getLocalIdentifier(*I, Record[0]); + if (II->isOutOfDate()) + updateOutOfDateIdentifier(*II); break; + } case PP_TOKEN: // Ignore tokens.