aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-18 16:41:56 -0700
committerPatrick Walton <[email protected]>2011-03-18 16:41:56 -0700
commitf3b58947c0c718d9366dac0c9df2c452e00a1ed3 (patch)
tree33746e2093d51596a6b9066d4be33e466c555028 /src/comp/middle
parentrustc: Move type_of() behind the check for dynamic size in trans_vec() (diff)
downloadrust-f3b58947c0c718d9366dac0c9df2c452e00a1ed3.tar.xz
rust-f3b58947c0c718d9366dac0c9df2c452e00a1ed3.zip
rustc: Don't always build a constant multiply instruction when translating literal vectors; the size of the referent isn't always constant
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/trans.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index a475dd36..92b147d2 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -4181,8 +4181,8 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
auto bcx = cx;
auto unit_sz = size_of(bcx, unit_ty);
bcx = unit_sz.bcx;
- auto data_sz = llvm.LLVMConstMul(C_int(_vec.len[@ast.expr](args) as int),
- unit_sz.val);
+ auto data_sz = bcx.build.Mul(C_int(_vec.len[@ast.expr](args) as int),
+ unit_sz.val);
// FIXME: pass tydesc properly.
auto sub = trans_upcall(bcx, "upcall_new_vec", vec(data_sz, C_int(0)));