aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-11 01:40:35 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-11 01:40:35 +0000
commit3aa1ab27c14d16c853ccb61f17a4a75d8e366806 (patch)
tree8852eb3e617a92e51c9a87e5a9693ad5e4d48c7c
parentfde3195488a4e9a6011e9d3ebadf0149c4d5e759 (diff)
Add some iterators to BugReporter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66621 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/BugReporter.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h
index 0350f91a2d..85430e366e 100644
--- a/include/clang/Analysis/PathSensitive/BugReporter.h
+++ b/include/clang/Analysis/PathSensitive/BugReporter.h
@@ -141,9 +141,23 @@ public:
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 @@ public:
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 @@ public:
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(); }