diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-12 21:07:46 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-12 21:07:46 +0000 |
commit | ad834d534e9a5db3d3baa09593775f83ceaff1f2 (patch) | |
tree | d32e3e0b772dbce67ebb80c1f5d33a8b53feda7d /lib/AST/DeclObjC.cpp | |
parent | 5bbe816cd08bd28a87e8dadedf2cafb19ebf3b0b (diff) |
[PCH] When completing an objc forward reference, do not serialize the chain of its categories because
it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its
categories list when deserializing.
Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference
was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization
is bug inducing and kinda gross, we should phase it out.
Fixes infinite loop in rdar://10418538.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 //===----------------------------------------------------------------------===// |