eval irgen: allow ,length fastpath for array types as well

This commit is contained in:
Ryan Fleury
2025-04-21 16:55:46 -07:00
parent 4fe602521a
commit 1c71b89387
+6 -1
View File
@@ -2312,7 +2312,11 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *root_expr)
} }
} }
} }
if(!matches_shorthand && e_type_kind_is_pointer_or_ref(e_type_kind_from_key(e_type_key_unwrap(result.type_key, E_TypeUnwrapFlag_AllDecorative)))) if(!matches_shorthand)
{
E_TypeKind type_kind = e_type_kind_from_key(e_type_key_unwrap(result.type_key, E_TypeUnwrapFlag_AllDecorative));
if(e_type_kind_is_pointer_or_ref(type_kind) ||
type_kind == E_TypeKind_Array)
{ {
E_Expr *lens_spec_expr = e_string2expr_lookup(e_ir_state->ctx->macro_map, str8_lit("array")); E_Expr *lens_spec_expr = e_string2expr_lookup(e_ir_state->ctx->macro_map, str8_lit("array"));
E_TypeKey lens_spec_type_key = lens_spec_expr->type_key; E_TypeKey lens_spec_type_key = lens_spec_expr->type_key;
@@ -2329,6 +2333,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *root_expr)
} }
} }
} }
}
//- rjf: if the evaluated type has a hook for an extra layer of ir extension, //- rjf: if the evaluated type has a hook for an extra layer of ir extension,
// call into it // call into it