From: Sean Callanan Date: Sat, 14 May 2016 06:11:19 +0000 (+0000) Subject: Fixed a bug where the ASTImporter didn't propagate builtin IDs at all. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43382e109c4b3a6ea809a241b79d56e0a14d3ff4;p=clang Fixed a bug where the ASTImporter didn't propagate builtin IDs at all. 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 --- diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index c1dda3fcf6..702828bd11 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -6546,7 +6546,12 @@ IdentifierInfo *ASTImporter::Import(const IdentifierInfo *FromId) { 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) {