diff options
author | Sean Callanan <scallanan@apple.com> | 2016-05-14 06:11:19 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2016-05-14 06:11:19 +0000 |
commit | f94ef1df8bd820852c35ece8a9d1253ee07247cb (patch) | |
tree | e46a490c5d54f944e993bf2dd14f2c63f19988d4 | |
parent | 4537ea74eb1f8eed74faf9f32897350360014d0a (diff) | |
download | bcm5719-llvm-f94ef1df8bd820852c35ece8a9d1253ee07247cb.tar.gz bcm5719-llvm-f94ef1df8bd820852c35ece8a9d1253ee07247cb.zip |
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.
llvm-svn: 269553
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index c1dda3fcf65..702828bd113 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/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) { |