mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-18 00:48:23 +00:00
Improve multiple return value copy-elision
This commit is contained in:
@@ -3338,6 +3338,17 @@ Type *get_struct_field_type(Type *t, isize index) {
|
||||
}
|
||||
|
||||
|
||||
Type *reduce_tuple_to_single_type(Type *original_type) {
|
||||
if (original_type != nullptr) {
|
||||
Type *t = core_type(original_type);
|
||||
if (t->kind == Type_Tuple && t->Tuple.variables.count == 1) {
|
||||
return t->Tuple.variables[0]->type;
|
||||
}
|
||||
}
|
||||
return original_type;
|
||||
}
|
||||
|
||||
|
||||
gbString write_type_to_string(gbString str, Type *type) {
|
||||
if (type == nullptr) {
|
||||
return gb_string_appendc(str, "<no type>");
|
||||
|
||||
Reference in New Issue
Block a user