From 7f4a0954bf7fabc5876acb51e54fff98be9efd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Fri, 16 Jul 2010 12:26:53 +0200 Subject: [PATCH] Also instantiate nodes called in iterators --- compiler/minils/transformations/callgraph_mapfold.ml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/minils/transformations/callgraph_mapfold.ml b/compiler/minils/transformations/callgraph_mapfold.ml index eedf247..32d2f85 100644 --- a/compiler/minils/transformations/callgraph_mapfold.ml +++ b/compiler/minils/transformations/callgraph_mapfold.ml @@ -91,11 +91,17 @@ let node_by_longname ln = (** @return the list of nodes called by the node named [ln], with the corresponding params (static parameters appear as free variables). *) let collect_node_calls ln = + let add_called_node ln params acc = + match ln with + | Modname { qual = "Pervasives" } -> acc + | _ -> (ln, params)::acc + in let edesc funs acc ed = match ed with | Eapp ({ a_op = (Enode ln | Efun ln); a_params = params }, _, _) -> - (match ln with - | Modname { qual = "Pervasives" } -> ed, acc - | _ -> ed, (ln, params)::acc) + ed, add_called_node ln params acc + | Eiterator(_, { a_op = (Enode ln | Efun ln); a_params = params }, + _, _, _) -> + ed, add_called_node ln params acc | _ -> raise Misc.Fallback in let funs = { Mls_mapfold.defaults with