summaryrefslogtreecommitdiff
path: root/src/analysis/cfg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/cfg.h')
-rw-r--r--src/analysis/cfg.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/analysis/cfg.h b/src/analysis/cfg.h
index ba4d7a774..c14cf70f4 100644
--- a/src/analysis/cfg.h
+++ b/src/analysis/cfg.h
@@ -40,6 +40,10 @@ struct BasicBlock {
iterator end() const { return insts.cend(); }
size_t size() const { return insts.size(); }
+ using reverse_iterator = std::vector<Expression*>::const_reverse_iterator;
+ reverse_iterator rbegin() const { return insts.rbegin(); }
+ reverse_iterator rend() const { return insts.rend(); }
+
// Iterables for predecessor and successor blocks.
struct Predecessors;
struct Successors;
@@ -48,6 +52,8 @@ struct BasicBlock {
void print(std::ostream& os, Module* wasm = nullptr, size_t start = 0) const;
+ Index getIndex() const { return index; }
+
private:
Index index;
std::vector<Expression*> insts;