r185784 - Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.

Craig Topper craig.topper at gmail.com
Sun Jul 7 20:55:10 PDT 2013


Author: ctopper
Date: Sun Jul  7 22:55:09 2013
New Revision: 185784

URL: http://llvm.org/viewvc/llvm-project?rev=185784&view=rev
Log:
Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.

Modified:
    cfe/trunk/lib/AST/ASTDiagnostic.cpp
    cfe/trunk/lib/Basic/Module.cpp
    cfe/trunk/lib/Format/Format.cpp
    cfe/trunk/lib/Parse/ParseTemplate.cpp
    cfe/trunk/lib/Sema/SemaCast.cpp
    cfe/trunk/tools/libclang/RecursiveASTVisitor.h

Modified: cfe/trunk/lib/AST/ASTDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDiagnostic.cpp?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDiagnostic.cpp (original)
+++ cfe/trunk/lib/AST/ASTDiagnostic.cpp Sun Jul  7 22:55:09 2013
@@ -1025,7 +1025,7 @@ class TemplateDiff {
     makeTemplateList(FromTemplateList, FromTST);
     makeTemplateList(ToTemplateList, ToTST);
 
-    SmallVector<const TemplateSpecializationType*, 1>::reverse_iterator
+    SmallVectorImpl<const TemplateSpecializationType *>::reverse_iterator
         FromIter = FromTemplateList.rbegin(), FromEnd = FromTemplateList.rend(),
         ToIter = ToTemplateList.rbegin(), ToEnd = ToTemplateList.rend();
 

Modified: cfe/trunk/lib/Basic/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Module.cpp?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Module.cpp (original)
+++ cfe/trunk/lib/Basic/Module.cpp Sun Jul  7 22:55:09 2013
@@ -111,8 +111,8 @@ std::string Module::getFullModuleName()
     Names.push_back(M->Name);
   
   std::string Result;
-  for (SmallVector<StringRef, 2>::reverse_iterator I = Names.rbegin(),
-                                                IEnd = Names.rend();
+  for (SmallVectorImpl<StringRef>::reverse_iterator I = Names.rbegin(),
+                                                 IEnd = Names.rend();
        I != IEnd; ++I) {
     if (!Result.empty())
       Result += '.';

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Sun Jul  7 22:55:09 2013
@@ -723,7 +723,7 @@ private:
         Current.is(tok::kw_return) ||
         (Previous && (Previous->opensScope() ||
                       Previous->getPrecedence() == prec::Assignment));
-    for (SmallVector<prec::Level, 4>::const_reverse_iterator
+    for (SmallVectorImpl<prec::Level>::const_reverse_iterator
              I = Current.FakeLParens.rbegin(),
              E = Current.FakeLParens.rend();
          I != E; ++I) {

Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Sun Jul  7 22:55:09 2013
@@ -1283,7 +1283,7 @@ void Parser::ParseLateTemplatedFuncDef(L
   }
 
   // Reenter template scopes from outermost to innermost.
-  SmallVector<DeclContext*, 4>::reverse_iterator II =
+  SmallVectorImpl<DeclContext *>::reverse_iterator II =
       DeclContextsToReenter.rbegin();
   for (; II != DeclContextsToReenter.rend(); ++II) {
     if (ClassTemplatePartialSpecializationDecl *MD =
@@ -1358,7 +1358,7 @@ void Parser::ParseLateTemplatedFuncDef(L
 
   // Exit scopes.
   FnScope.Exit();
-  SmallVector<ParseScope*, 4>::reverse_iterator I =
+  SmallVectorImpl<ParseScope *>::reverse_iterator I =
    TemplateParamScopeStack.rbegin();
   for (; I != TemplateParamScopeStack.rend(); ++I)
     delete *I;

Modified: cfe/trunk/lib/Sema/SemaCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCast.cpp Sun Jul  7 22:55:09 2013
@@ -511,8 +511,8 @@ CastsAwayConstness(Sema &Self, QualType
   QualType SrcConstruct = Self.Context.VoidTy;
   QualType DestConstruct = Self.Context.VoidTy;
   ASTContext &Context = Self.Context;
-  for (SmallVector<Qualifiers, 8>::reverse_iterator i1 = cv1.rbegin(),
-                                                          i2 = cv2.rbegin();
+  for (SmallVectorImpl<Qualifiers>::reverse_iterator i1 = cv1.rbegin(),
+                                                     i2 = cv2.rbegin();
        i1 != cv1.rend(); ++i1, ++i2) {
     SrcConstruct
       = Context.getPointerType(Context.getQualifiedType(SrcConstruct, *i1));

Modified: cfe/trunk/tools/libclang/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/RecursiveASTVisitor.h?rev=185784&r1=185783&r2=185784&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/RecursiveASTVisitor.h (original)
+++ cfe/trunk/tools/libclang/RecursiveASTVisitor.h Sun Jul  7 22:55:09 2013
@@ -502,7 +502,7 @@ bool RecursiveASTVisitor<Derived>::Trave
       }
     }
 
-    for (SmallVector<Stmt *, 8>::reverse_iterator
+    for (SmallVectorImpl<Stmt *>::reverse_iterator
            RI = StmtsToEnqueu.rbegin(),
            RE = StmtsToEnqueu.rend(); RI != RE; ++RI)
       Queue.push_back(*RI);





More information about the cfe-commits mailing list