From be7a7d6f2e5b86807afd08a568863df973baaa38 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 14 Jan 2008 23:18:55 +0000 Subject: [PATCH] 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 --- include/clang/AST/CFG.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.50.1