mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
Fix Addressing for SOA on store; Add intrinsics.type_struct_field_count(T)
This commit is contained in:
@@ -5768,6 +5768,20 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
|
||||
}
|
||||
break;
|
||||
|
||||
case BuiltinProc_type_struct_field_count:
|
||||
operand->value = exact_value_i64(0);
|
||||
if (operand->mode != Addressing_Type) {
|
||||
error(operand->expr, "Expected a struct type for '%.*s'", LIT(builtin_name));
|
||||
} else if (!is_type_struct(operand->type)) {
|
||||
error(operand->expr, "Expected a struct type for '%.*s'", LIT(builtin_name));
|
||||
} else {
|
||||
Type *bt = base_type(operand->type);
|
||||
operand->value = exact_value_i64(bt->Struct.fields.count);
|
||||
}
|
||||
operand->mode = Addressing_Constant;
|
||||
operand->type = t_untyped_integer;
|
||||
break;
|
||||
|
||||
case BuiltinProc_type_proc_parameter_count:
|
||||
operand->value = exact_value_i64(0);
|
||||
if (operand->mode != Addressing_Type) {
|
||||
|
||||
Reference in New Issue
Block a user