From 50fd8381405b1a37688e6114753d376086fd69eb 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. llvm-svn: 45984 --- clang/include/clang/AST/CFG.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/CFG.h b/clang/include/clang/AST/CFG.h index 054358875c9c..8fc65ef4360e 100644 --- a/clang/include/clang/AST/CFG.h +++ b/clang/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; -- GitLab