Reverse r138567 until a buildbot failure is investigated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138584 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 8768236..7a9d6d5 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1654,14 +1654,14 @@
}
/// ActOnForwardClassDeclaration -
-Sema::DeclGroupPtrTy
+Decl *
Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
IdentifierInfo **IdentList,
SourceLocation *IdentLocs,
unsigned NumElts) {
- SmallVector<Decl *, 8> DeclsInGroup;
+ SmallVector<ObjCInterfaceDecl*, 32> Interfaces;
+
for (unsigned i = 0; i != NumElts; ++i) {
- SmallVector<ObjCInterfaceDecl*, 1> Interfaces;
// Check for another declaration kind with the same name.
NamedDecl *PrevDecl
= LookupSingleName(TUScope, IdentList[i], IdentLocs[i],
@@ -1707,15 +1707,15 @@
}
Interfaces.push_back(IDecl);
- ObjCClassDecl *CDecl = ObjCClassDecl::Create(Context, CurContext, AtClassLoc,
- Interfaces.data(), IdentLocs,
- 1);
- CurContext->addDecl(CDecl);
- CheckObjCDeclScope(CDecl);
- DeclsInGroup.push_back(CDecl);
}
-
- return BuildDeclaratorGroup(DeclsInGroup.data(), DeclsInGroup.size(), false);
+
+ assert(Interfaces.size() == NumElts);
+ ObjCClassDecl *CDecl = ObjCClassDecl::Create(Context, CurContext, AtClassLoc,
+ Interfaces.data(), IdentLocs,
+ Interfaces.size());
+ CurContext->addDecl(CDecl);
+ CheckObjCDeclScope(CDecl);
+ return CDecl;
}
static bool tryMatchRecordTypes(ASTContext &Context,