From 43f3c2698df5a8ecd2efe4e039d5b29b0b47125d Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 14 May 2016 06:24:14 +0000 Subject: [PATCH] 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 --- lib/Serialization/ASTReader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. -- 2.50.1