diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-01 19:29:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-01 19:29:29 +0000 |
commit | 5e2a1ff9f28d2eab256d2553e76a9c9d54693875 (patch) | |
tree | 9b6a413be6f25d57bd1e0737cb63227d337493e5 /lib/AST/ASTImporter.cpp | |
parent | 27b7ce6199bfd008ba8d10c8bd91d926e2274df3 (diff) |
Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTImporter.cpp')
-rw-r--r-- | lib/AST/ASTImporter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 67045059cf..fe7049492f 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -3119,7 +3119,7 @@ Decl *ASTNodeImporter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { } ObjCProtocolDecl *ToProto = MergeWithProtocol; - if (!ToProto || ToProto->isForwardDecl()) { + if (!ToProto || !ToProto->hasDefinition()) { if (!ToProto) { ToProto = ObjCProtocolDecl::Create(Importer.getToContext(), DC, Name.getAsIdentifierInfo(), Loc, @@ -3127,9 +3127,12 @@ Decl *ASTNodeImporter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { D->isInitiallyForwardDecl()); ToProto->setLexicalDeclContext(LexicalDC); LexicalDC->addDeclInternal(ToProto); - if (D->isInitiallyForwardDecl() && !D->isForwardDecl()) + if (D->isInitiallyForwardDecl() && D->hasDefinition()) ToProto->completedForwardDecl(); } + if (!ToProto->hasDefinition()) + ToProto->startDefinition(); + Importer.Imported(D, ToProto); // Import protocols |