From 04fe23a3c860ea29998c290d2a0dc94ee240a53a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 19 Mar 2020 10:57:14 +0000 Subject: Have different categories for optimization passes --- src/types.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 73023001a..6d880cdec 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -3190,6 +3190,14 @@ i64 type_offset_of_from_selection(Type *type, Selection sel) { return offset; } + +Type *get_struct_field_type(Type *t, isize index) { + t = base_type(type_deref(t)); + GB_ASSERT(t->kind == Type_Struct); + return t->Struct.fields[index]->type; +} + + gbString write_type_to_string(gbString str, Type *type) { if (type == nullptr) { return gb_string_appendc(str, ""); -- cgit v1.2.3