diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-11 01:40:35 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-11 01:40:35 +0000 |
commit | b9ee1f74fd3ced61c3905a93b599c92192a4b63c (patch) | |
tree | a658eaefb67a21b437faae2cb82779eab58a7a11 | |
parent | 2533d2b85ba0c199f0bfaaa669b28fa07ff194a2 (diff) | |
download | bcm5719-llvm-b9ee1f74fd3ced61c3905a93b599c92192a4b63c.tar.gz bcm5719-llvm-b9ee1f74fd3ced61c3905a93b599c92192a4b63c.zip |
Add some iterators to BugReporter.
llvm-svn: 66621
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/BugReporter.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/BugReporter.h b/clang/include/clang/Analysis/PathSensitive/BugReporter.h index 0350f91a2d7..85430e366ef 100644 --- a/clang/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/clang/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(); } |