length_of align_of size_of are no longer operators but function calls

This commit is contained in:
Krzosa Karol
2022-09-27 13:50:30 +02:00
parent 60f794580c
commit dda2252ca2
4 changed files with 146 additions and 134 deletions

View File

@@ -362,9 +362,10 @@ gen_expr(Ast_Expr *ast, Ast_Type *type_of_var){
BREAK();
}
CASE(LENGTH_OF, Builtin){
gen_expr(node->expr);
if(is_pointer(node->expr->resolved_type))
CASE(LENGTH_OF, Call){
Ast_Expr *expr = unpack_ast_call_expr_for_builtin(node);
gen_expr(expr);
if(is_pointer(expr->resolved_type))
gen("->len");
else gen(".len");
BREAK();