diff options
| author | Patrick Walton <[email protected]> | 2011-03-18 16:41:56 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-18 16:41:56 -0700 |
| commit | f3b58947c0c718d9366dac0c9df2c452e00a1ed3 (patch) | |
| tree | 33746e2093d51596a6b9066d4be33e466c555028 /src/comp | |
| parent | rustc: Move type_of() behind the check for dynamic size in trans_vec() (diff) | |
| download | rust-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')
| -rw-r--r-- | src/comp/middle/trans.rs | 4 |
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))); |