Fix some indentation and a stray comment.

master
Rohan Jacob-Rao 10 years ago
parent 0a2571c10a
commit 5e5fac5dbc

@ -302,8 +302,6 @@ fast_math_flags:
binop_args:
| typ operand COMMA operand { () }
(* below is fuzzy *)
operand:
| var = variable { Var var }
| const = constant { Const const }

@ -78,15 +78,15 @@ let rec trans_annotated_instructions
let new_sil_instr =
Sil.Set (trans_variable var, trans_typ tp, trans_operand op, location) in
(new_sil_instr :: sil_instrs, locals)
| Alloc (var, tp, num_elems) ->
(* num_elems currently ignored *)
begin match var with
| Global (Name var_name) | Local (Name var_name) ->
let new_local = (Mangled.from_string var_name, trans_typ (Tptr tp)) in
(sil_instrs, new_local :: locals)
| _ -> raise (ImproperTypeError "Not expecting alloca instruction to a numbered variable.")
end
| _ -> raise (Unimplemented "Need to translate instruction to SIL.")
| Alloc (var, tp, num_elems) ->
(* num_elems currently ignored *)
begin match var with
| Global (Name var_name) | Local (Name var_name) ->
let new_local = (Mangled.from_string var_name, trans_typ (Tptr tp)) in
(sil_instrs, new_local :: locals)
| _ -> raise (ImproperTypeError "Not expecting alloca instruction to a numbered variable.")
end
| _ -> raise (Unimplemented "Need to translate instruction to SIL.")
end
(* Update CFG and call graph with new function definition *)

Loading…
Cancel
Save