Allocator uses protocols. Fix bug where it was not possible to pass a ref variable as a ref variable. Correct codegen for !anyptr.

This commit is contained in:
Christoffer Lerno
2023-10-14 02:09:11 +02:00
committed by Christoffer Lerno
parent 54f32ed71b
commit 89d4c2cab7
31 changed files with 1439 additions and 1431 deletions

View File

@@ -2606,6 +2606,12 @@ static void llvm_emit_unary_expr(GenContext *c, BEValue *value, Expr *expr)
llvm_value_rvalue(c, value);
llvm_value = LLVMBuildIsNull(c->builder, value->value, "not");
break;
case TYPE_ANYPTR:
case TYPE_PROPTR:
llvm_emit_any_pointer(c, value, value);
llvm_value_rvalue(c, value);
llvm_value = LLVMBuildIsNull(c->builder, value->value, "not");
break;
default:
DEBUG_LOG("Unexpectedly tried to not %s", type_quoted_error_string(inner->type));
UNREACHABLE