]> granicus.if.org Git - clang/commitdiff
More ArrayRef-ification of methods.
authorBill Wendling <isanbard@gmail.com>
Wed, 22 Feb 2012 09:51:33 +0000 (09:51 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 22 Feb 2012 09:51:33 +0000 (09:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151152 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTDiagnostic.h
include/clang/AST/DeclBase.h
include/clang/Basic/Diagnostic.h
lib/AST/ASTDiagnostic.cpp
lib/AST/DeclBase.cpp
lib/Basic/Diagnostic.cpp
lib/Sema/SemaTemplateDeduction.cpp

index 6e3637200462f5c79dd9eef2e5d830eef7ee1f9a..64e955ea1472951872cd86849f828b5785a04f7b 100644 (file)
@@ -44,7 +44,7 @@ namespace clang {
       unsigned NumPrevArgs,
       SmallVectorImpl<char> &Output,
       void *Cookie,
-      SmallVectorImpl<intptr_t> &QualTypeVals);
+      ArrayRef<intptr_t> QualTypeVals);
 }  // end namespace clang
 
 #endif
index 896b12f61e6d22cc335e469404c3aeeb0b0a576c..72f82aa9e383082ff52af7b3afcf4c8555a23bb9 100644 (file)
@@ -961,7 +961,7 @@ protected:
   ///
   /// \returns the first/last pair of declarations.
   static std::pair<Decl *, Decl *>
-  BuildDeclChain(const SmallVectorImpl<Decl*> &Decls, bool FieldsAlreadyLoaded);
+  BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
 
    DeclContext(Decl::Kind K)
      : DeclKind(K), ExternalLexicalStorage(false),
index f9eaf99c95dd9daf4500228f0d6577f3f54d0478..3e54b4352b6801d4d1457440bc358d74282d8192 100644 (file)
@@ -289,7 +289,7 @@ private:
       unsigned NumPrevArgs,
       SmallVectorImpl<char> &Output,
       void *Cookie,
-      SmallVectorImpl<intptr_t> &QualTypeVals);
+      ArrayRef<intptr_t> QualTypeVals);
   void *ArgToStringCookie;
   ArgToStringFnTy ArgToStringFn;
 
index dd3be44a1f5601c0bd418f574768afa6e88a804c..9e0a360fcb542f82a01d33d2e8dafb4ca2c5f346 100644 (file)
@@ -154,17 +154,16 @@ static std::string
 ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty,
                               const DiagnosticsEngine::ArgumentValue *PrevArgs,
                               unsigned NumPrevArgs,
-                              SmallVectorImpl<intptr_t> &QualTypeVals) {
+                              ArrayRef<intptr_t> QualTypeVals) {
   // FIXME: Playing with std::string is really slow.
   bool ForceAKA = false;
   QualType CanTy = Ty.getCanonicalType();
   std::string S = Ty.getAsString(Context.getPrintingPolicy());
   std::string CanS = CanTy.getAsString(Context.getPrintingPolicy());
 
-  for (SmallVectorImpl<intptr_t>::iterator I = QualTypeVals.begin(),
-       E = QualTypeVals.end(); I != E; ++I) {
+  for (unsigned I = 0, E = QualTypeVals.size(); I != E; ++I) {
     QualType CompareTy =
-        QualType::getFromOpaquePtr(reinterpret_cast<void*>(*I));
+        QualType::getFromOpaquePtr(reinterpret_cast<void*>(QualTypeVals[I]));
     if (CompareTy == Ty)
       continue;  // Same types
     QualType CompareCanTy = CompareTy.getCanonicalType();
@@ -235,7 +234,7 @@ void clang::FormatASTNodeDiagnosticArgument(
     unsigned NumPrevArgs,
     SmallVectorImpl<char> &Output,
     void *Cookie,
-    SmallVectorImpl<intptr_t> &QualTypeVals) {
+    ArrayRef<intptr_t> QualTypeVals) {
   ASTContext &Context = *static_cast<ASTContext*>(Cookie);
   
   std::string S;
index efbc5f992381b0d5f8ecec92d4b078993dca3739..dbb0b6bfa4c6396e63336fc0a055e8d49e0dc3b5 100644 (file)
@@ -872,7 +872,7 @@ DeclContext::collectAllContexts(llvm::SmallVectorImpl<DeclContext *> &Contexts){
 }
 
 std::pair<Decl *, Decl *>
-DeclContext::BuildDeclChain(const SmallVectorImpl<Decl*> &Decls,
+DeclContext::BuildDeclChain(ArrayRef<Decl*> Decls,
                             bool FieldsAlreadyLoaded) {
   // Build up a chain of declarations via the Decl::NextInContextAndBits field.
   Decl *FirstNewDecl = 0;
index c2631bba3fab8b9a0c12c60b334c58c48dd70347..4a63d9793356381135c80851d897679c20dfbf02 100644 (file)
@@ -27,7 +27,7 @@ static void DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
                                unsigned NumPrevArgs,
                                SmallVectorImpl<char> &Output,
                                void *Cookie,
-                               SmallVectorImpl<intptr_t> &QualTypeVals) {
+                               ArrayRef<intptr_t> QualTypeVals) {
   const char *Str = "<can't format argument>";
   Output.append(Str, Str+strlen(Str));
 }
index f2051e92981439358434465bb101d75f845a01d3..d6cfc1aac765129661553afc9d8019c13879ced6 100644 (file)
@@ -583,7 +583,7 @@ FinishArgumentPackDeduction(Sema &S,
                             TemplateParameterList *TemplateParams,
                             bool HasAnyArguments,
                         SmallVectorImpl<DeducedTemplateArgument> &Deduced,
-                            const SmallVectorImpl<unsigned> &PackIndices,
+                            ArrayRef<unsigned> PackIndices,
                     SmallVectorImpl<DeducedTemplateArgument> &SavedPacks,
         SmallVectorImpl<
           SmallVector<DeducedTemplateArgument, 4> > &NewlyDeducedPacks,