From f3afc6848ba15cf55b6eb4848639d8c675ae2933 Mon Sep 17 00:00:00 2001 From: Rohan Jacob-Rao Date: Thu, 13 Aug 2015 12:01:26 -0700 Subject: [PATCH] Open Utils module to avoid prefixing common list functions. --- infer/src/llvm/lParser.mly | 7 ++++--- infer/src/llvm/lTrans.ml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/infer/src/llvm/lParser.mly b/infer/src/llvm/lParser.mly index e896ed5ae..180aaac72 100644 --- a/infer/src/llvm/lParser.mly +++ b/infer/src/llvm/lParser.mly @@ -7,6 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. *) %{ + open Utils open LAst %} @@ -155,9 +156,9 @@ prog: | targets defs = func_def* opt_mappings = metadata_def* EOF { - let mappings = Utils.list_flatten_options opt_mappings in + let mappings = list_flatten_options opt_mappings in let add_mapping map (metadata_id, components) = MetadataMap.add metadata_id components map in - let metadata_map = Utils.list_fold_left add_mapping MetadataMap.empty mappings in + let metadata_map = list_fold_left add_mapping MetadataMap.empty mappings in Prog (defs, metadata_map) } targets: @@ -240,7 +241,7 @@ ptr_typ: | tp = typ STAR { tp } block: - | LBRACE annotated_instrs = annotated_instr* RBRACE { Utils.list_flatten_options annotated_instrs } + | LBRACE annotated_instrs = annotated_instr* RBRACE { list_flatten_options annotated_instrs } annotated_instr: | instruction = real_instr anno = annotation? { Some (instruction, anno) } diff --git a/infer/src/llvm/lTrans.ml b/infer/src/llvm/lTrans.ml index e789f3f5b..d42923766 100644 --- a/infer/src/llvm/lTrans.ml +++ b/infer/src/llvm/lTrans.ml @@ -7,6 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. *) +open Utils open LAst exception ImproperTypeError of string @@ -114,7 +115,7 @@ let trans_func_def (cfg : Cfg.cfg) (cg: Cg.t) (metadata : LAst.metadata_map) ret_type = (match ret_tp_opt with | None -> Sil.Tvoid | Some ret_tp -> trans_typ ret_tp); - formals = Utils.list_map (fun (tp, name) -> (name, trans_typ tp)) params; + formals = list_map (fun (tp, name) -> (name, trans_typ tp)) params; locals = []; (* TODO *) captured = []; loc = Sil.dummy_location @@ -133,7 +134,7 @@ let trans_func_def (cfg : Cfg.cfg) (cg: Cg.t) (metadata : LAst.metadata_map) | [] -> Cfg.Node.set_succs_exn start_node [exit_node] [exit_node] | nd :: nds -> Cfg.Node.set_succs_exn start_node [nd] [exit_node]; link_nodes nd nds in let (sil_instrs, locals) = trans_annotated_instrs cfg procdesc metadata annotated_instrs in - let nodes = Utils.list_map (node_of_sil_instr cfg procdesc) sil_instrs in + let nodes = list_map (node_of_sil_instr cfg procdesc) sil_instrs in Cfg.Procdesc.set_start_node procdesc start_node; Cfg.Procdesc.set_exit_node procdesc exit_node; link_nodes start_node nodes; @@ -145,5 +146,5 @@ let trans_prog : LAst.prog -> Cfg.cfg * Cg.t * Sil.tenv = function let cfg = Cfg.Node.create_cfg () in let cg = Cg.create () in let tenv = Sil.create_tenv () in - Utils.list_iter (trans_func_def cfg cg metadata) func_defs; + list_iter (trans_func_def cfg cg metadata) func_defs; (cfg, cg, tenv)