Commit e49a1073 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[ir2cabs] systematically use mk_int64_cst for translating integer constants

parent 8ec33c82
......@@ -2043,16 +2043,7 @@ and convert_initializer env typ var init_exp does_remove_virtual =
loc)
in
let eidx = { expr_loc = loc; expr_node = VARIABLE idx } in
let end_test =
{ expr_loc = loc;
expr_node =
BINARY(
LT,
eidx,
{ expr_loc = loc;
expr_node =
CONSTANT (CONST_INT (Int64.to_string v)) }) }
in
let end_test = mk_expr env (BINARY(LT,eidx,mk_int64_cst env v)) in
let increment =
{ expr_loc = loc; expr_node = UNARY(POSINCR, eidx)}
in
......@@ -2532,9 +2523,7 @@ let convert_static_const env loc name ikind kind value does_remove_virtual =
| ICStaticConst -> SpecStorage STATIC :: spec
| ICLiteral | ICExternConst -> spec
in
let init = { expr_loc = cloc;
expr_node = CONSTANT (CONST_INT (Int64.to_string value))}
in
let init = mk_int64_cst env value in
let env = Convert_env.add_global_var env qualified_name plain in
DECDEF(None,(spec,[(name,JUSTBASE,[],cloc),SINGLE_INIT init]),cloc), env
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment