diff options
| author | gingerBill <bill@gingerbill.org> | 2020-03-19 10:57:14 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-03-19 10:57:14 +0000 |
| commit | 04fe23a3c860ea29998c290d2a0dc94ee240a53a (patch) | |
| tree | f51b2627345bf3fa251918982759e9cf23dca1e9 /src/types.cpp | |
| parent | 1707e004eca1a2f6406f56db7924da3992618107 (diff) | |
Have different categories for optimization passes
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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, "<no type>"); |