IdentifierInfos are assigned builtin IDs during parsing, but Idents.get() does
not do that work. So the ASTImporter needs to additionally set the builtin ID
for the newly-created IdentifierInfo. This patch does that.
Currently ASTMerge tests only check syntax and the ASTMatchers don't check for
builtin IDs, so this is tricky to test, but LLDB will have a test for this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269553
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!FromId)
return nullptr;
- return &ToContext.Idents.get(FromId->getName());
+ IdentifierInfo *ToId = &ToContext.Idents.get(FromId->getName());
+
+ if (!ToId->getBuiltinID() && FromId->getBuiltinID())
+ ToId->setBuiltinID(FromId->getBuiltinID());
+
+ return ToId;
}
Selector ASTImporter::Import(Selector FromSel) {