From: Benjamin Kramer Date: Sun, 27 May 2012 13:28:52 +0000 (+0000) Subject: Use the SelectorSet typedef more widely throughout Sema. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=811bfcd823d51db6a06b3fd5a5943ff910b79d68;p=clang Use the SelectorSet typedef more widely throughout Sema. While there make it a SmallPtrSet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157532 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 98baeb0b8b..80bfde4ca3 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2189,7 +2189,7 @@ public: bool isPropertyReadonly(ObjCPropertyDecl *PropertyDecl, ObjCInterfaceDecl *IDecl); - typedef llvm::DenseSet > SelectorSet; + typedef llvm::SmallPtrSet SelectorSet; typedef llvm::DenseMap ProtocolsMethodsMap; /// CheckProtocolMethodDefs - This routine checks unimplemented diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9e640b4540..3bcc8ce650 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1491,8 +1491,8 @@ void Sema::WarnExactTypedMethods(ObjCMethodDecl *ImpMethodDecl, void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, ObjCProtocolDecl *PDecl, bool& IncompleteImpl, - const llvm::DenseSet &InsMap, - const llvm::DenseSet &ClsMap, + const SelectorSet &InsMap, + const SelectorSet &ClsMap, ObjCContainerDecl *CDecl) { ObjCCategoryDecl *C = dyn_cast(CDecl); ObjCInterfaceDecl *IDecl = C ? C->getClassInterface() @@ -1588,10 +1588,10 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, /// MatchAllMethodDeclarations - Check methods declared in interface /// or protocol against those declared in their implementations. /// -void Sema::MatchAllMethodDeclarations(const llvm::DenseSet &InsMap, - const llvm::DenseSet &ClsMap, - llvm::DenseSet &InsMapSeen, - llvm::DenseSet &ClsMapSeen, +void Sema::MatchAllMethodDeclarations(const SelectorSet &InsMap, + const SelectorSet &ClsMap, + SelectorSet &InsMapSeen, + SelectorSet &ClsMapSeen, ObjCImplDecl* IMPDecl, ObjCContainerDecl* CDecl, bool &IncompleteImpl, @@ -1687,7 +1687,7 @@ void Sema::MatchAllMethodDeclarations(const llvm::DenseSet &InsMap, /// warns each time an exact match is found. void Sema::CheckCategoryVsClassMethodMatches( ObjCCategoryImplDecl *CatIMPDecl) { - llvm::DenseSet InsMap, ClsMap; + SelectorSet InsMap, ClsMap; for (ObjCImplementationDecl::instmeth_iterator I = CatIMPDecl->instmeth_begin(), @@ -1708,7 +1708,7 @@ void Sema::CheckCategoryVsClassMethodMatches( ObjCInterfaceDecl *IDecl = CatDecl->getClassInterface(); if (!IDecl) return; - llvm::DenseSet InsMapSeen, ClsMapSeen; + SelectorSet InsMapSeen, ClsMapSeen; bool IncompleteImpl = false; MatchAllMethodDeclarations(InsMap, ClsMap, InsMapSeen, ClsMapSeen, CatIMPDecl, IDecl, @@ -1719,7 +1719,7 @@ void Sema::CheckCategoryVsClassMethodMatches( void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl, ObjCContainerDecl* CDecl, bool IncompleteImpl) { - llvm::DenseSet InsMap; + SelectorSet InsMap; // Check and see if instance methods in class interface have been // implemented in the implementation class. for (ObjCImplementationDecl::instmeth_iterator @@ -1734,7 +1734,7 @@ void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl, IDecl->isObjCRequiresPropertyDefs()) DiagnoseUnimplementedProperties(S, IMPDecl, CDecl, InsMap); - llvm::DenseSet ClsMap; + SelectorSet ClsMap; for (ObjCImplementationDecl::classmeth_iterator I = IMPDecl->classmeth_begin(), E = IMPDecl->classmeth_end(); I != E; ++I) @@ -1742,7 +1742,7 @@ void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl, // Check for type conflict of methods declared in a class/protocol and // its implementation; if any. - llvm::DenseSet InsMapSeen, ClsMapSeen; + SelectorSet InsMapSeen, ClsMapSeen; MatchAllMethodDeclarations(InsMap, ClsMap, InsMapSeen, ClsMapSeen, IMPDecl, CDecl, IncompleteImpl, true); diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 222eaac7f0..88de7d315e 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1523,7 +1523,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, Decl *D) { void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl, ObjCContainerDecl *CDecl, - const llvm::DenseSet& InsMap) { + const SelectorSet &InsMap) { llvm::DenseMap SuperPropMap; if (ObjCInterfaceDecl *IDecl = dyn_cast(CDecl)) CollectSuperClassPropertyImplementations(IDecl, SuperPropMap);