aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/ASTImporter.cpp8
-rw-r--r--lib/AST/DeclObjC.cpp14
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index f7a55a1474..318f6f2897 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -3111,9 +3111,10 @@ Decl *ASTNodeImporter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) {
Name.getAsIdentifierInfo(), Loc,
Importer.Import(D->getAtStartLoc()),
D->isInitiallyForwardDecl());
- ToProto->setForwardDecl(D->isForwardDecl());
ToProto->setLexicalDeclContext(LexicalDC);
LexicalDC->addDeclInternal(ToProto);
+ if (D->isInitiallyForwardDecl() && !D->isForwardDecl())
+ ToProto->completedForwardDecl();
}
Importer.Imported(D, ToProto);
@@ -3172,11 +3173,12 @@ Decl *ASTNodeImporter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
ToIface = ObjCInterfaceDecl::Create(Importer.getToContext(), DC,
Importer.Import(D->getAtStartLoc()),
Name.getAsIdentifierInfo(), Loc,
- D->isForwardDecl(),
+ D->isInitiallyForwardDecl(),
D->isImplicitInterfaceDecl());
- ToIface->setForwardDecl(D->isForwardDecl());
ToIface->setLexicalDeclContext(LexicalDC);
LexicalDC->addDeclInternal(ToIface);
+ if (D->isInitiallyForwardDecl() && !D->isForwardDecl())
+ ToIface->completedForwardDecl();
}
Importer.Imported(D, ToIface);
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 5c4d25fd02..35ee7c6ccd 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -217,6 +217,13 @@ void ObjCInterfaceDecl::mergeClassExtensionProtocolList(
AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(), C);
}
+void ObjCInterfaceDecl::completedForwardDecl() {
+ assert(isForwardDecl() && "Only valid to call for forward refs");
+ ForwardDecl = false;
+ if (ASTMutationListener *L = getASTContext().getASTMutationListener())
+ L->CompletedObjCForwardRef(this);
+}
+
/// getFirstClassExtension - Find first class extension of the given class.
ObjCCategoryDecl* ObjCInterfaceDecl::getFirstClassExtension() const {
for (ObjCCategoryDecl *CDecl = getCategoryList(); CDecl;
@@ -913,6 +920,13 @@ ObjCMethodDecl *ObjCProtocolDecl::lookupMethod(Selector Sel,
return NULL;
}
+void ObjCProtocolDecl::completedForwardDecl() {
+ assert(isForwardDecl() && "Only valid to call for forward refs");
+ isForwardProtoDecl = false;
+ if (ASTMutationListener *L = getASTContext().getASTMutationListener())
+ L->CompletedObjCForwardRef(this);
+}
+
//===----------------------------------------------------------------------===//
// ObjCClassDecl
//===----------------------------------------------------------------------===//