summaryrefslogtreecommitdiff
path: root/src/ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.h')
-rw-r--r--src/ir.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ir.h b/src/ir.h
index 29e63060..caf56689 100644
--- a/src/ir.h
+++ b/src/ir.h
@@ -404,7 +404,8 @@ struct Exception {
TypeVector sig;
};
-struct LocalTypes {
+class LocalTypes {
+ public:
typedef std::pair<Type, Index> Decl;
typedef std::vector<Decl> Decls;
@@ -421,13 +422,21 @@ struct LocalTypes {
void Set(const TypeVector&);
+ const Decls& decls() const { return decls_; }
+
+ void AppendDecl(Type type, Index count) {
+ assert(count > 0);
+ decls_.emplace_back(type, count);
+ }
+
Index size() const;
Type operator[](Index) const;
- const_iterator begin() const { return {decls.begin(), 0}; }
- const_iterator end() const { return {decls.end(), 0}; }
+ const_iterator begin() const { return {decls_.begin(), 0}; }
+ const_iterator end() const { return {decls_.end(), 0}; }
- Decls decls;
+ private:
+ Decls decls_;
};
inline LocalTypes::const_iterator& LocalTypes::const_iterator::operator++() {