diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-21 21:41:56 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-21 21:41:56 +0000 |
commit | 24c8991f4dd0ab86678b5ab11f05586687b55be9 (patch) | |
tree | 50defd3e554fad9cdedf93ac775308ffad4384a4 /lib/AST | |
parent | 5bd0939989e31113dcded537176311a822682422 (diff) |
Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
- I don't know how to make a test case for this, but this strengthens
the invariants that hold internally. The functionality change here
is the edit to SemaDeclObjC.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ASTContext.cpp | 3 | ||||
-rw-r--r-- | lib/AST/DeclObjC.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index cfff4b5440..c4597e2235 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -644,6 +644,9 @@ void ASTContext::CollectObjCIvars(const ObjCInterfaceDecl *OI, /// ivars and all those inherited. /// const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D) { + // FIXME: The only client relying on this working in the presence of + // forward declarations is IRgen, which should not need it. Fix + // and simplify this code. RecordDecl *&RD = ASTRecordForInterface[D]; if (RD) { // If we have a record decl already and it is either a definition or if 'D' diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 9cc22912ca..5df5ff3a7a 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -381,6 +381,7 @@ ObjCInterfaceDecl::FindCategoryDeclaration(IdentifierInfo *CategoryId) const { const FieldDecl * ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, const ObjCIvarDecl *IVar) const { + assert(!isForwardDecl() && "Invalid interface decl!"); const RecordDecl *RecordForDecl = Context.addRecordToClass(this); assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class"); DeclContext::lookup_const_result Lookup = |