about summary refs log tree commit diff
path: root/boot/ir.c
diff options
context:
space:
mode:
Diffstat (limited to 'boot/ir.c')
-rw-r--r--boot/ir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/boot/ir.c b/boot/ir.c
index af631f8..f1ae951 100644
--- a/boot/ir.c
+++ b/boot/ir.c
@@ -589,6 +589,18 @@ struct Unit
     Array(struct Lower_Error) lower_errors;
 };
 
+struct Type*
+unit_get_type(struct Unit* unit, Type_Id id)
+{
+    return *array_at(struct Type*, &unit->types.entries, id);
+}
+
+struct Function*
+unit_get_function(struct Unit* unit, Function_Id id)
+{
+    return *array_at(struct Function*, &unit->functions.entries, id);
+}
+
 REGION(struct Type, type)
 REGION(struct Function, function)
 REGION(struct Statement, statement)