Corrected ptr->bool conversion. Avoid checking function body if function is invalid. Switch defer test cases.

This commit is contained in:
Christoffer Lerno
2020-07-27 14:58:02 +02:00
committed by Christoffer Lerno
parent c839eb50c8
commit 90ab4f07b9
18 changed files with 346 additions and 212 deletions

View File

@@ -294,7 +294,7 @@ LLVMValueRef gencontext_emit_cast(GenContext *context, CastKind cast_kind, LLVMV
case CAST_EUBOOL:
return LLVMBuildICmp(context->builder, LLVMIntNE, value, gencontext_emit_no_error_union(context), "eubool");
case CAST_PTRBOOL:
return LLVMBuildICmp(context->builder, LLVMIntNE, value, LLVMConstPointerNull(llvm_type(from_type->canonical)), "ptrbool");
return LLVMBuildIsNotNull(context->builder, value, "ptrbool");
case CAST_BOOLINT:
return LLVMBuildTrunc(context->builder, value, llvm_type(to_type), "boolsi");
case CAST_FPBOOL: