aboutsummaryrefslogtreecommitdiff
path: root/src/ssa
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssa')
-rw-r--r--src/ssa/ssa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ssa/ssa.c b/src/ssa/ssa.c
index 405d8e4..707ccd0 100644
--- a/src/ssa/ssa.c
+++ b/src/ssa/ssa.c
@@ -342,8 +342,8 @@ static CHECK_RESULT SsaRegister lhsexpr_generate_ssa(Ast *self, SsaCompilerConte
if(lhs_expr->is_extern)
return lhsexpr_extern_generate_ssa(lhs_expr, context);
- if(is_not_null(lhs_expr->rhs_expr)) {
- Ast *rhs_expr = nullable_unwrap(lhs_expr->rhs_expr);
+ if(lhs_expr->rhs_expr) {
+ Ast *rhs_expr = lhs_expr->rhs_expr;
SsaRegister rhs_reg;
rhs_reg = ast_generate_ssa(rhs_expr, context);
/*
@@ -433,7 +433,7 @@ static CHECK_RESULT SsaRegister funccall_generate_ssa(Ast *self, SsaCompilerCont
throw_if_error(ssa_ins_push(context->ssa, arg_reg));
}
- assert((is_not_null(self->resolve_data.type->rhs_expr) && nullable_unwrap(self->resolve_data.type->rhs_expr)->type == AST_FUNCTION_DECL) ||
+ assert((self->resolve_data.type->rhs_expr && self->resolve_data.type->rhs_expr->type == AST_FUNCTION_DECL) ||
self->resolve_data.type->type.type == VARIABLE_TYPE_SIGNATURE);
if(self->resolve_data.type->is_extern) {
amal_log_error("TODO: Implement extern function call (extern function %.*s was called)", func_call->func.name.size, func_call->func.name.data);
@@ -442,7 +442,7 @@ static CHECK_RESULT SsaRegister funccall_generate_ssa(Ast *self, SsaCompilerCont
} else {
FunctionDecl *func_to_call;
/* rhs wont be null here because only extern variable can't have rhs */
- func_to_call = nullable_unwrap(self->resolve_data.type->rhs_expr)->value.func_decl;
+ func_to_call = self->resolve_data.type->rhs_expr->value.func_decl;
amal_log_debug("SSA funccall %.*s, func index ptr: %p", func_call->func.name.size, func_call->func.name.data, func_to_call);
throw_if_error(ssa_ins_call(context->ssa, func_to_call, &reg));
}