Replace as casts with type-conversion functions.

This commit is contained in:
Dan Gohman
2017-11-08 10:41:09 -08:00
parent 7c579a80c2
commit 889b06fd16
15 changed files with 54 additions and 47 deletions

View File

@@ -43,7 +43,7 @@ fn dynamic_addr(
bound_gv: ir::GlobalVar,
func: &mut ir::Function,
) {
let size = size as i64;
let size = i64::from(size);
let offset_ty = func.dfg.value_type(offset);
let addr_ty = func.dfg.value_type(func.dfg.first_result(inst));
let min_size = func.heaps[heap].min_size.into();
@@ -96,7 +96,7 @@ fn static_addr(
bound: i64,
func: &mut ir::Function,
) {
let size = size as i64;
let size = i64::from(size);
let offset_ty = func.dfg.value_type(offset);
let addr_ty = func.dfg.value_type(func.dfg.first_result(inst));
let mut pos = FuncCursor::new(func).at_inst(inst);