]> granicus.if.org Git - clang/commitdiff
Update identifiers as needed when loading macros from serialized ASTs.
authorSean Callanan <scallanan@apple.com>
Sat, 14 May 2016 06:24:14 +0000 (06:24 +0000)
committerSean Callanan <scallanan@apple.com>
Sat, 14 May 2016 06:24:14 +0000 (06:24 +0000)
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

index 0f4a7d326670e2779a7cd505b0ec6e38fa626178..8650ce757698210e4773589324fa60417704cd69 100644 (file)
@@ -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.