mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-21 03:44:27 -04:00
Delay determination of procedure abi types until as late as possible to prevent type undetermination in self-referential data types #454
This commit is contained in:
1 parent
4aad45e3e7
commit
ee8d3e03f8
5 files changed
+29
-12
No files matched your search
+7
-2
@@ -205,6 +205,7 @@ struct TypeUnion {
|
||||
Type * abi_compat_result_type; \
|
||||
i32 variadic_index; \
|
||||
bool variadic; \
|
||||
bool abi_types_set; \
|
||||
bool require_results; \
|
||||
bool c_vararg; \
|
||||
bool is_polymorphic; \
|
||||
@@ -2360,7 +2361,9 @@ i64 type_size_of(Type *t) {
|
||||
return 0;
|
||||
}
|
||||
// NOTE(bill): Always calculate the size when it is a Type_Basic
|
||||
if (t->kind != Type_Basic && t->cached_size >= 0) {
|
||||
if (t->kind == Type_Named && t->cached_size >= 0) {
|
||||
|
||||
} else if (t->kind != Type_Basic && t->cached_size >= 0) {
|
||||
return t->cached_size;
|
||||
}
|
||||
TypePath path = {0};
|
||||
@@ -2375,7 +2378,9 @@ i64 type_align_of(Type *t) {
|
||||
return 1;
|
||||
}
|
||||
// NOTE(bill): Always calculate the size when it is a Type_Basic
|
||||
if (t->kind != Type_Basic && t->cached_align > 0) {
|
||||
if (t->kind == Type_Named && t->cached_align >= 0) {
|
||||
|
||||
} if (t->kind != Type_Basic && t->cached_align > 0) {
|
||||
return t->cached_align;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user