r269554 - Update identifiers as needed when loading macros from serialized ASTs.

Sean Callanan via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 23:24:16 PDT 2016


Author: spyffe
Date: Sat May 14 01:24:14 2016
New Revision: 269554

URL: http://llvm.org/viewvc/llvm-project?rev=269554&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Serialization/ASTReader.cpp

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=269554&r1=269553&r2=269554&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Sat May 14 01:24:14 2016
@@ -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.




More information about the cfe-commits mailing list