summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/lib/AST/DeclObjC.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index cfff4b54402..c4597e2235e 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 9cc22912caf..5df5ff3a7ad 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/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 =
OpenPOWER on IntegriCloud