[cfe-commits] r66621 - /cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h

Ted Kremenek kremenek at apple.com
Tue Mar 10 18:40:35 PDT 2009


Author: kremenek
Date: Tue Mar 10 20:40:35 2009
New Revision: 66621

URL: http://llvm.org/viewvc/llvm-project?rev=66621&view=rev
Log:
Add some iterators to BugReporter.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h?rev=66621&r1=66620&r2=66621&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h Tue Mar 10 20:40:35 2009
@@ -141,9 +141,23 @@
     BugReport* operator*() const { return *impl; }
     BugReport* operator->() const { return *impl; }
   };
+  
+  class const_iterator {
+    std::list<BugReport*>::const_iterator impl;
+  public:
+    const_iterator(std::list<BugReport*>::const_iterator i) : impl(i) {}
+    const_iterator& operator++() { ++impl; return *this; }
+    bool operator==(const const_iterator& I) const { return I.impl == impl; }
+    bool operator!=(const const_iterator& I) const { return I.impl != impl; }
+    const BugReport* operator*() const { return *impl; }
+    const BugReport* operator->() const { return *impl; }
+  };
     
   iterator begin() { return iterator(Reports.begin()); }
   iterator end() { return iterator(Reports.end()); }
+  
+  const_iterator begin() const { return const_iterator(Reports.begin()); }
+  const_iterator end() const { return const_iterator(Reports.end()); }
 };
   
 class BugType {
@@ -162,6 +176,14 @@
 
   virtual void FlushReports(BugReporter& BR);  
   void AddReport(BugReport* BR);  
+  
+  typedef llvm::FoldingSet<BugReportEquivClass>::iterator iterator;
+  iterator begin() { return EQClasses.begin(); }
+  iterator end() { return EQClasses.end(); }
+  
+  typedef llvm::FoldingSet<BugReportEquivClass>::const_iterator const_iterator;
+  const_iterator begin() const { return EQClasses.begin(); }
+  const_iterator end() const { return EQClasses.end(); }
 };
   
 //===----------------------------------------------------------------------===//
@@ -244,6 +266,10 @@
     return D.getPathDiagnosticClient();
   }
   
+  typedef BugTypesTy::iterator iterator;
+  iterator begin() { return BugTypes.begin(); }
+  iterator end() { return BugTypes.end(); }
+  
   ASTContext& getContext() { return D.getContext(); }
   
   SourceManager& getSourceManager() { return D.getSourceManager(); }





More information about the cfe-commits mailing list