mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 21:38:40 +00:00
eval irgen: allow ,length fastpath for array types as well
This commit is contained in:
+18
-13
@@ -2312,20 +2312,25 @@ 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_Expr *lens_spec_expr = e_string2expr_lookup(e_ir_state->ctx->macro_map, str8_lit("array"));
|
E_TypeKind type_kind = e_type_kind_from_key(e_type_key_unwrap(result.type_key, E_TypeUnwrapFlag_AllDecorative));
|
||||||
E_TypeKey lens_spec_type_key = lens_spec_expr->type_key;
|
if(e_type_kind_is_pointer_or_ref(type_kind) ||
|
||||||
E_Type *lens_spec_type = e_type_from_key__cached(lens_spec_type_key);
|
type_kind == E_TypeKind_Array)
|
||||||
result.type_key = e_type_key_cons(.kind = E_TypeKind_Lens,
|
{
|
||||||
.flags = lens_spec_type->flags,
|
E_Expr *lens_spec_expr = e_string2expr_lookup(e_ir_state->ctx->macro_map, str8_lit("array"));
|
||||||
.count = 1,
|
E_TypeKey lens_spec_type_key = lens_spec_expr->type_key;
|
||||||
.args = &chained_expr,
|
E_Type *lens_spec_type = e_type_from_key__cached(lens_spec_type_key);
|
||||||
.direct_key = result.type_key,
|
result.type_key = e_type_key_cons(.kind = E_TypeKind_Lens,
|
||||||
.name = lens_spec_type->name,
|
.flags = lens_spec_type->flags,
|
||||||
.irext = lens_spec_type->irext,
|
.count = 1,
|
||||||
.access = lens_spec_type->access,
|
.args = &chained_expr,
|
||||||
.expand = lens_spec_type->expand);
|
.direct_key = result.type_key,
|
||||||
|
.name = lens_spec_type->name,
|
||||||
|
.irext = lens_spec_type->irext,
|
||||||
|
.access = lens_spec_type->access,
|
||||||
|
.expand = lens_spec_type->expand);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user