diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-01 21:23:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-01 21:23:57 +0000 |
commit | bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 (patch) | |
tree | 827657aa0ed457521e505ae199c93c9166b7181f /lib/Sema/SemaDeclObjC.cpp | |
parent | a6387f3b447015073192f1e1cafec3ebd0294c8c (diff) |
Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 3612e94371..51d282a546 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -694,14 +694,12 @@ void Sema::DiagnoseClassExtensionDupMethods(ObjCCategoryDecl *CAT, } /// ActOnForwardProtocolDeclaration - Handle @protocol foo; -Decl * +Sema::DeclGroupPtrTy Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc, const IdentifierLocPair *IdentList, unsigned NumElts, AttributeList *attrList) { - SmallVector<ObjCProtocolDecl*, 32> Protocols; - SmallVector<SourceLocation, 8> ProtoLocs; - + SmallVector<Decl *, 8> DeclsInGroup; for (unsigned i = 0; i != NumElts; ++i) { IdentifierInfo *Ident = IdentList[i].first; ObjCProtocolDecl *PrevDecl = LookupProtocol(Ident, IdentList[i].second, @@ -712,6 +710,7 @@ Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc, PrevDecl, /*isForwardDecl=*/true); PushOnScopeChains(PDecl, TUScope); + CheckObjCDeclScope(PDecl); if (attrList) ProcessDeclAttributeList(TUScope, PDecl, attrList); @@ -719,17 +718,10 @@ Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc, if (PrevDecl) mergeDeclAttributes(PDecl, PrevDecl); - Protocols.push_back(PDecl); - ProtoLocs.push_back(IdentList[i].second); + DeclsInGroup.push_back(PDecl); } - ObjCForwardProtocolDecl *PDecl = - ObjCForwardProtocolDecl::Create(Context, CurContext, AtProtocolLoc, - Protocols.data(), Protocols.size(), - ProtoLocs.data()); - CurContext->addDecl(PDecl); - CheckObjCDeclScope(PDecl); - return PDecl; + return BuildDeclaratorGroup(DeclsInGroup.data(), DeclsInGroup.size(), false); } Decl *Sema:: |