aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-02-23 10:39:57 +0000
committergingerBill <bill@gingerbill.org>2020-02-23 10:39:57 +0000
commite197af766d5ead2a1a67ead4c780848c6749a5b1 (patch)
treea874c73d31366c8fdcccd7546e4294d5df51a6d6 /src/ir.cpp
parent2180f4a475287546b9230745343ca3e0847525c6 (diff)
parent10fe5e97b3eea5409660220a903bc6ad09478c1b (diff)
Merge branch 'master' into llvm-integration
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 8171d774d..982576a2b 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -5714,7 +5714,7 @@ irValue *ir_emit_transmute(irProcedure *proc, irValue *value, Type *t) {
}
// TODO(bill): Actually figure out what the conversion needs to be correctly 'cause LLVM
- return ir_emit_bitcast(proc, value, dst);
+ return ir_emit_bitcast(proc, value, t);
}
@@ -7348,10 +7348,11 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
GB_ASSERT(are_types_identical(ir_type(left), key_type));
Type *it = bit_set_to_int(rt);
+ left = ir_emit_conv(proc, left, it);
irValue *lower = ir_value_constant(it, exact_value_i64(rt->BitSet.lower));
- irValue *key = ir_emit_arith(proc, Token_Sub, left, lower, ir_type(left));
- irValue *bit = ir_emit_arith(proc, Token_Shl, v_one, key, ir_type(left));
+ irValue *key = ir_emit_arith(proc, Token_Sub, left, lower, it);
+ irValue *bit = ir_emit_arith(proc, Token_Shl, v_one, key, it);
bit = ir_emit_conv(proc, bit, it);
irValue *old_value = ir_emit_bitcast(proc, right, it);