diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-01-14 23:18:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-01-14 23:18:55 +0000 |
commit | be7a7d6f2e5b86807afd08a568863df973baaa38 (patch) | |
tree | 96cea8aafa71cdaeb715b5e8a93f3c7f48bd2d93 | |
parent | 21dd821423a4700f6b11c2e87949b49d061c3183 (diff) |
Added operator[] for CFGBlock. This provides random access to the statements
of a block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45984 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/CFG.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/AST/CFG.h b/include/clang/AST/CFG.h index 054358875c..8fc65ef436 100644 --- a/include/clang/AST/CFG.h +++ b/include/clang/AST/CFG.h @@ -103,7 +103,10 @@ public: unsigned size() const { return Stmts.size(); } bool empty() const { return Stmts.empty(); } - + + Stmt*& operator[](size_t i) { assert (i < size()); return Stmts[i]; } + Stmt* operator[](size_t i) const { assert (i < size()); return Stmts[i]; } + // CFG iterators typedef AdjacentBlocks::iterator pred_iterator; typedef AdjacentBlocks::const_iterator const_pred_iterator; |