From: Argyrios Kyrtzidis Date: Sat, 18 Jun 2011 00:53:34 +0000 (+0000) Subject: [arcmt] Const'ify. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60a5e3f90031191f18128eab8326eea70b266b27;p=clang [arcmt] Const'ify. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133322 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 04c35e28c8..a93f1c62c0 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -53,11 +53,11 @@ bool CapturedDiagList::clearDiagnostic(llvm::ArrayRef IDs, } bool CapturedDiagList::hasDiagnostic(llvm::ArrayRef IDs, - SourceRange range) { + SourceRange range) const { if (range.isInvalid()) return false; - ListTy::iterator I = List.begin(); + ListTy::const_iterator I = List.begin(); while (I != List.end()) { FullSourceLoc diagLoc = I->getLocation(); if ((IDs.empty() || // empty means any diagnostic in the range. @@ -74,8 +74,8 @@ bool CapturedDiagList::hasDiagnostic(llvm::ArrayRef IDs, return false; } -void CapturedDiagList::reportDiagnostics(Diagnostic &Diags) { - for (ListTy::iterator I = List.begin(), E = List.end(); I != E; ++I) +void CapturedDiagList::reportDiagnostics(Diagnostic &Diags) const { + for (ListTy::const_iterator I = List.begin(), E = List.end(); I != E; ++I) Diags.Report(*I); } diff --git a/lib/ARCMigrate/Internals.h b/lib/ARCMigrate/Internals.h index fdc0aad176..d0d545ec51 100644 --- a/lib/ARCMigrate/Internals.h +++ b/lib/ARCMigrate/Internals.h @@ -27,9 +27,9 @@ public: void push_back(const StoredDiagnostic &diag) { List.push_back(diag); } bool clearDiagnostic(llvm::ArrayRef IDs, SourceRange range); - bool hasDiagnostic(llvm::ArrayRef IDs, SourceRange range); + bool hasDiagnostic(llvm::ArrayRef IDs, SourceRange range) const; - void reportDiagnostics(Diagnostic &diags); + void reportDiagnostics(Diagnostic &diags) const; }; class TransformActions {