| ... | @@ -7050,16 +7050,12 @@ check: switch (const_val->special) { | ... | @@ -7050,16 +7050,12 @@ check: switch (const_val->special) { |
| 7050 | case ZigTypeIdEnum: | 7050 | case ZigTypeIdEnum: |
| 7051 | return bigint_to_llvm_const(get_llvm_type(g, type_entry), &const_val->data.x_enum_tag); | 7051 | return bigint_to_llvm_const(get_llvm_type(g, type_entry), &const_val->data.x_enum_tag); |
| 7052 | case ZigTypeIdFn: | 7052 | case ZigTypeIdFn: |
| 7053 | if (const_val->data.x_ptr.special == ConstPtrSpecialFunction) { | 7053 | if (const_val->data.x_ptr.special == ConstPtrSpecialFunction && |
| 7054 | assert(const_val->data.x_ptr.mut == ConstPtrMutComptimeConst); | 7054 | const_val->data.x_ptr.mut != ConstPtrMutComptimeConst) { |
| 7055 | return fn_llvm_value(g, const_val->data.x_ptr.data.fn.fn_entry); | | |
| 7056 | } else if (const_val->data.x_ptr.special == ConstPtrSpecialHardCodedAddr) { | | |
| 7057 | LLVMTypeRef usize_type_ref = g->builtin_types.entry_usize->llvm_type; | | |
| 7058 | uint64_t addr = const_val->data.x_ptr.data.hard_coded_addr.addr; | | |
| 7059 | return LLVMConstIntToPtr(LLVMConstInt(usize_type_ref, addr, false), get_llvm_type(g, type_entry)); | | |
| 7060 | } else { | | |
| 7061 | zig_unreachable(); | 7055 | zig_unreachable(); |
| 7062 | } | 7056 | } |
| | 7057 | // Treat it the same as we do for pointers |
| | 7058 | return gen_const_val_ptr(g, const_val, name); |
| 7063 | case ZigTypeIdPointer: | 7059 | case ZigTypeIdPointer: |
| 7064 | return gen_const_val_ptr(g, const_val, name); | 7060 | return gen_const_val_ptr(g, const_val, name); |
| 7065 | case ZigTypeIdErrorUnion: | 7061 | case ZigTypeIdErrorUnion: |