From: Ted Kremenek Date: Mon, 14 Jan 2008 23:18:55 +0000 (+0000) Subject: Added operator[] for CFGBlock. This provides random access to the statements X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be7a7d6f2e5b86807afd08a568863df973baaa38;p=clang 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 --- 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;