From 5e5fac5dbcaf76d5861b6ea877d1b4992b173a3c Mon Sep 17 00:00:00 2001 From: Rohan Jacob-Rao Date: Sat, 15 Aug 2015 14:02:41 -0700 Subject: [PATCH] Fix some indentation and a stray comment. --- infer/src/llvm/lParser.mly | 2 -- infer/src/llvm/lTrans.ml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/infer/src/llvm/lParser.mly b/infer/src/llvm/lParser.mly index e7d28ca67..9adb9fb38 100644 --- a/infer/src/llvm/lParser.mly +++ b/infer/src/llvm/lParser.mly @@ -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 } diff --git a/infer/src/llvm/lTrans.ml b/infer/src/llvm/lTrans.ml index 6c08623f6..174bf6fbb 100644 --- a/infer/src/llvm/lTrans.ml +++ b/infer/src/llvm/lTrans.ml @@ -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 *)