From d06559340425af487eeb8a00bc3b495617f97fbc Mon Sep 17 00:00:00 2001 From: qining Date: Fri, 12 Aug 2016 13:12:43 -0400 Subject: [PATCH] Add iterator getter interface for types_values_ --- source/opt/module.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/source/opt/module.h b/source/opt/module.h index 1aee9127c..5a487b7d4 100644 --- a/source/opt/module.h +++ b/source/opt/module.h @@ -110,6 +110,12 @@ class Module { IteratorRange annotations(); IteratorRange annotations() const; + // Iterators for types, constants and global variables instructions. + inline inst_iterator types_values_begin(); + inline inst_iterator types_values_end(); + inline IteratorRange types_values(); + inline IteratorRange types_values() const; + // Iterators for functions contained in this module. iterator begin() { return iterator(&functions_, functions_.begin()); } iterator end() { return iterator(&functions_, functions_.end()); } @@ -213,6 +219,22 @@ inline IteratorRange Module::annotations() const { return make_const_range(annotations_); } +inline Module::inst_iterator Module::types_values_begin() { + return inst_iterator(&types_values_, types_values_.begin()); +} + +inline Module::inst_iterator Module::types_values_end() { + return inst_iterator(&types_values_, types_values_.end()); +} + +inline IteratorRange Module::types_values() { + return make_range(types_values_); +} + +inline IteratorRange Module::types_values() const { + return make_const_range(types_values_); +} + inline Module::const_iterator Module::cbegin() const { return const_iterator(&functions_, functions_.cbegin()); }