]> granicus.if.org Git - clang/commitdiff
[arcmt] Const'ify.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jun 2011 00:53:34 +0000 (00:53 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jun 2011 00:53:34 +0000 (00:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133322 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/ARCMT.cpp
lib/ARCMigrate/Internals.h

index 04c35e28c89efca211e0ce996c8270163f9d8756..a93f1c62c0ef430bdd716e4107e430de148ae00a 100644 (file)
@@ -53,11 +53,11 @@ bool CapturedDiagList::clearDiagnostic(llvm::ArrayRef<unsigned> IDs,
 }
 
 bool CapturedDiagList::hasDiagnostic(llvm::ArrayRef<unsigned> 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<unsigned> 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);
 }
 
index fdc0aad176c18a4df40bac988967ddcbf67d7085..d0d545ec517887431288d142bdb48ef6c08e3583 100644 (file)
@@ -27,9 +27,9 @@ public:
   void push_back(const StoredDiagnostic &diag) { List.push_back(diag); }
 
   bool clearDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
-  bool hasDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
+  bool hasDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range) const;
 
-  void reportDiagnostics(Diagnostic &diags);
+  void reportDiagnostics(Diagnostic &diags) const;
 };
 
 class TransformActions {