mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
IR: pass genericFnWithImplicitCast test
This commit is contained in:
1 parent
f6ac2fa70e
commit
94f977a6c1
3 files changed
+14
-12
No files matched your search
+3
-1
@@ -1567,7 +1567,9 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
|
||||
}
|
||||
|
||||
static LLVMValueRef gen_non_null_bit(CodeGen *g, TypeTableEntry *maybe_type, LLVMValueRef maybe_handle) {
|
||||
bool maybe_is_ptr = (maybe_type->id == TypeTableEntryIdPointer || maybe_type->id == TypeTableEntryIdFn);
|
||||
assert(maybe_type->id == TypeTableEntryIdMaybe);
|
||||
TypeTableEntry *child_type = maybe_type->data.maybe.child_type;
|
||||
bool maybe_is_ptr = (child_type->id == TypeTableEntryIdPointer || child_type->id == TypeTableEntryIdFn);
|
||||
if (maybe_is_ptr) {
|
||||
return LLVMBuildICmp(g->builder, LLVMIntNE, maybe_handle, LLVMConstNull(maybe_type->type_ref), "");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user