From: Craig Topper Date: Sun, 17 Aug 2014 23:49:53 +0000 (+0000) Subject: Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=effa2bc6d812f1e5a0709ea587a44648f877ef9d;p=clang Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215869 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Serialization/ModuleManager.h b/include/clang/Serialization/ModuleManager.h index f066fdf9a6..d84ab4d629 100644 --- a/include/clang/Serialization/ModuleManager.h +++ b/include/clang/Serialization/ModuleManager.h @@ -232,7 +232,7 @@ public: /// Any module that is known to both the global module index and the module /// manager that is *not* in this set can be skipped. void visit(bool (*Visitor)(ModuleFile &M, void *UserData), void *UserData, - llvm::SmallPtrSet *ModuleFilesHit = nullptr); + llvm::SmallPtrSetImpl *ModuleFilesHit = nullptr); /// \brief Visit each of the modules with a depth-first traversal. /// diff --git a/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/lib/Frontend/Rewrite/RewriteModernObjC.cpp index c97fa979f6..4fe8f74cd1 100644 --- a/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -508,7 +508,7 @@ namespace { void GetBlockDeclRefExprs(Stmt *S); void GetInnerBlockDeclRefExprs(Stmt *S, SmallVectorImpl &InnerBlockDeclRefs, - llvm::SmallPtrSet &InnerContexts); + llvm::SmallPtrSetImpl &InnerContexts); // We avoid calling Type::isBlockPointerType(), since it operates on the // canonical type. We only care if the top-level type is a closure pointer. @@ -4595,7 +4595,7 @@ void RewriteModernObjC::GetBlockDeclRefExprs(Stmt *S) { void RewriteModernObjC::GetInnerBlockDeclRefExprs(Stmt *S, SmallVectorImpl &InnerBlockDeclRefs, - llvm::SmallPtrSet &InnerContexts) { + llvm::SmallPtrSetImpl &InnerContexts) { for (Stmt::child_range CI = S->children(); CI; ++CI) if (*CI) { if (BlockExpr *CBE = dyn_cast(*CI)) { diff --git a/lib/Frontend/Rewrite/RewriteObjC.cpp b/lib/Frontend/Rewrite/RewriteObjC.cpp index 8d48d9e7b6..e96ff78c60 100644 --- a/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -413,7 +413,7 @@ namespace { void GetBlockDeclRefExprs(Stmt *S); void GetInnerBlockDeclRefExprs(Stmt *S, SmallVectorImpl &InnerBlockDeclRefs, - llvm::SmallPtrSet &InnerContexts); + llvm::SmallPtrSetImpl &InnerContexts); // We avoid calling Type::isBlockPointerType(), since it operates on the // canonical type. We only care if the top-level type is a closure pointer. @@ -3701,7 +3701,7 @@ void RewriteObjC::GetBlockDeclRefExprs(Stmt *S) { void RewriteObjC::GetInnerBlockDeclRefExprs(Stmt *S, SmallVectorImpl &InnerBlockDeclRefs, - llvm::SmallPtrSet &InnerContexts) { + llvm::SmallPtrSetImpl &InnerContexts) { for (Stmt::child_range CI = S->children(); CI; ++CI) if (*CI) { if (BlockExpr *CBE = dyn_cast(*CI)) { diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 9c0be3e76f..dda4075525 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6692,7 +6692,7 @@ static void checkIsValidOpenCLKernelParameter( Sema &S, Declarator &D, ParmVarDecl *Param, - llvm::SmallPtrSet &ValidTypes) { + llvm::SmallPtrSetImpl &ValidTypes) { QualType PT = Param->getType(); // Cache the valid types we encounter to avoid rechecking structs that are diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e676466e4e..18fda0314e 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2205,13 +2205,13 @@ namespace { Sema &S; // List of Decls to generate a warning on. Also remove Decls that become // initialized. - llvm::SmallPtrSet &Decls; + llvm::SmallPtrSetImpl &Decls; // If non-null, add a note to the warning pointing back to the constructor. const CXXConstructorDecl *Constructor; public: typedef EvaluatedExprVisitor Inherited; UninitializedFieldVisitor(Sema &S, - llvm::SmallPtrSet &Decls, + llvm::SmallPtrSetImpl &Decls, const CXXConstructorDecl *Constructor) : Inherited(S.Context), S(S), Decls(Decls), Constructor(Constructor) { } @@ -2350,7 +2350,7 @@ namespace { } }; static void CheckInitExprContainsUninitializedFields( - Sema &S, Expr *E, llvm::SmallPtrSet &Decls, + Sema &S, Expr *E, llvm::SmallPtrSetImpl &Decls, const CXXConstructorDecl *Constructor) { if (Decls.size() == 0) return; @@ -5910,7 +5910,7 @@ namespace { /// \brief Check whether any most overriden method from MD in Methods static bool CheckMostOverridenMethods(const CXXMethodDecl *MD, - const llvm::SmallPtrSet& Methods) { + const llvm::SmallPtrSetImpl& Methods) { if (MD->size_overridden_methods() == 0) return Methods.count(MD->getCanonicalDecl()); for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), @@ -5972,7 +5972,7 @@ static bool FindHiddenVirtualMethod(const CXXBaseSpecifier *Specifier, /// \brief Add the most overriden methods from MD to Methods static void AddMostOverridenMethods(const CXXMethodDecl *MD, - llvm::SmallPtrSet& Methods) { + llvm::SmallPtrSetImpl& Methods) { if (MD->size_overridden_methods() == 0) Methods.insert(MD->getCanonicalDecl()); for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 0032294926..0963c1ee3d 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -116,7 +116,7 @@ static unsigned deduceWeakPropertyFromType(Sema &S, QualType T) { static void CheckPropertyAgainstProtocol(Sema &S, ObjCPropertyDecl *Prop, ObjCProtocolDecl *Proto, - llvm::SmallPtrSet &Known) { + llvm::SmallPtrSetImpl &Known) { // Have we seen this protocol before? if (!Known.insert(Proto)) return; diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 12e0ef7fa6..78c3c56634 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1243,13 +1243,13 @@ namespace { // the evaluated decls into a vector. Simple is set to true if none // of the excluded constructs are used. class DeclExtractor : public EvaluatedExprVisitor { - llvm::SmallPtrSet &Decls; + llvm::SmallPtrSetImpl &Decls; SmallVectorImpl &Ranges; bool Simple; public: typedef EvaluatedExprVisitor Inherited; - DeclExtractor(Sema &S, llvm::SmallPtrSet &Decls, + DeclExtractor(Sema &S, llvm::SmallPtrSetImpl &Decls, SmallVectorImpl &Ranges) : Inherited(S.Context), Decls(Decls), @@ -1321,13 +1321,13 @@ namespace { // DeclMatcher checks to see if the decls are used in a non-evauluated // context. class DeclMatcher : public EvaluatedExprVisitor { - llvm::SmallPtrSet &Decls; + llvm::SmallPtrSetImpl &Decls; bool FoundDecl; public: typedef EvaluatedExprVisitor Inherited; - DeclMatcher(Sema &S, llvm::SmallPtrSet &Decls, + DeclMatcher(Sema &S, llvm::SmallPtrSetImpl &Decls, Stmt *Statement) : Inherited(S.Context), Decls(Decls), FoundDecl(false) { if (!Statement) return; @@ -1410,8 +1410,8 @@ namespace { if (Decls.size() == 0) return; // Don't warn on volatile, static, or global variables. - for (llvm::SmallPtrSet::iterator I = Decls.begin(), - E = Decls.end(); + for (llvm::SmallPtrSetImpl::iterator I = Decls.begin(), + E = Decls.end(); I != E; ++I) if ((*I)->getType().isVolatileQualified() || (*I)->hasGlobalStorage()) return; @@ -1426,8 +1426,8 @@ namespace { PDiag << 0; else { PDiag << Decls.size(); - for (llvm::SmallPtrSet::iterator I = Decls.begin(), - E = Decls.end(); + for (llvm::SmallPtrSetImpl::iterator I = Decls.begin(), + E = Decls.end(); I != E; ++I) PDiag << (*I)->getDeclName(); } diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 38837e2c06..05d3bab9a7 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -2962,13 +2962,13 @@ namespace { class RedeclChainVisitor { ASTReader &Reader; SmallVectorImpl &SearchDecls; - llvm::SmallPtrSet &Deserialized; + llvm::SmallPtrSetImpl &Deserialized; GlobalDeclID CanonID; SmallVector Chain; public: RedeclChainVisitor(ASTReader &Reader, SmallVectorImpl &SearchDecls, - llvm::SmallPtrSet &Deserialized, + llvm::SmallPtrSetImpl &Deserialized, GlobalDeclID CanonID) : Reader(Reader), SearchDecls(SearchDecls), Deserialized(Deserialized), CanonID(CanonID) { @@ -3087,7 +3087,7 @@ namespace { ASTReader &Reader; serialization::GlobalDeclID InterfaceID; ObjCInterfaceDecl *Interface; - llvm::SmallPtrSet &Deserialized; + llvm::SmallPtrSetImpl &Deserialized; unsigned PreviousGeneration; ObjCCategoryDecl *Tail; llvm::DenseMap NameCategoryMap; @@ -3135,7 +3135,7 @@ namespace { ObjCCategoriesVisitor(ASTReader &Reader, serialization::GlobalDeclID InterfaceID, ObjCInterfaceDecl *Interface, - llvm::SmallPtrSet &Deserialized, + llvm::SmallPtrSetImpl &Deserialized, unsigned PreviousGeneration) : Reader(Reader), InterfaceID(InterfaceID), Interface(Interface), Deserialized(Deserialized), PreviousGeneration(PreviousGeneration), diff --git a/lib/Serialization/ModuleManager.cpp b/lib/Serialization/ModuleManager.cpp index 2c10c119a0..8b0a4ed494 100644 --- a/lib/Serialization/ModuleManager.cpp +++ b/lib/Serialization/ModuleManager.cpp @@ -249,7 +249,7 @@ ModuleManager::~ModuleManager() { void ModuleManager::visit(bool (*Visitor)(ModuleFile &M, void *UserData), void *UserData, - llvm::SmallPtrSet *ModuleFilesHit) { + llvm::SmallPtrSetImpl *ModuleFilesHit) { // If the visitation order vector is the wrong size, recompute the order. if (VisitOrder.size() != Chain.size()) { unsigned N = size();