| ... | @@ -2002,7 +2002,7 @@ static LLVMValueRef ir_llvm_value(CodeGen *g, IrInstruction *instruction) { | ... | @@ -2002,7 +2002,7 @@ static LLVMValueRef ir_llvm_value(CodeGen *g, IrInstruction *instruction) { |
| 2002 | render_const_val_global(g, &instruction->value, ""); | 2002 | render_const_val_global(g, &instruction->value, ""); |
| 2003 | ZigType *ptr_type = get_pointer_to_type(g, instruction->value.type, true); | 2003 | ZigType *ptr_type = get_pointer_to_type(g, instruction->value.type, true); |
| 2004 | instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_global, get_llvm_type(g, ptr_type), ""); | 2004 | instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_global, get_llvm_type(g, ptr_type), ""); |
| 2005 | } else if (instruction->value.type->id == ZigTypeIdPointer) { | 2005 | } else if (get_codegen_ptr_type(instruction->value.type) != nullptr) { |
| 2006 | instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_value, | 2006 | instruction->llvm_value = LLVMBuildBitCast(g->builder, instruction->value.global_refs->llvm_value, |
| 2007 | get_llvm_type(g, instruction->value.type), ""); | 2007 | get_llvm_type(g, instruction->value.type), ""); |
| 2008 | } else { | 2008 | } else { |