summary refs log tree commit diff
path: root/source/xi/pipeline.ml
diff options
context:
space:
mode:
Diffstat (limited to 'source/xi/pipeline.ml')
-rw-r--r--source/xi/pipeline.ml14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/xi/pipeline.ml b/source/xi/pipeline.ml
index 34a06f9..ae9a4c9 100644
--- a/source/xi/pipeline.ml
+++ b/source/xi/pipeline.ml
@@ -31,10 +31,21 @@ module Make(Steps:COMPILER_STEPS)(Params:PARAMS) = struct
     Logger.dump_string "regmapping" @@ describe_register_mapping mapping
 
   let dump_schedule proc_ir schedule = 
-    let title = Format.sprintf "%s.schedule" (Ir_utils.string_of_procid @@ Ir.procid_of_procedure proc_ir) in
+    let title = Format.sprintf "%s.schedule" (Ir_utils.string_of_procid proc_ir) in
     let output = Ir_utils.string_of_labellist schedule in
     Logger.dump_string title output
 
+  let dump_node2type node2type =
+    let title = "types" in 
+    let f k v xs =
+      let line = Format.sprintf "%s -> %s"
+        (Ast.string_of_node_tag k)
+        (Types.string_of_normal_type v) in
+      line :: xs
+    in
+    let lines = Hashtbl.fold f node2type [] in
+    Logger.dump_string title @@ String.concat "\n" @@ List.sort compare lines
+
   module IrPhases = struct
 
     let regalloc proc =
@@ -111,6 +122,7 @@ module Make(Steps:COMPILER_STEPS)(Params:PARAMS) = struct
       List.iter prerr_endline xs;
       Error "typechecker"
     | Ok (node2type) ->
+      dump_node2type node2type;
       if Invariants.AllExpressionsAreTypecheck.verify_module_definition node2type ast then
         check_stop_point "typechecker" translate (ast, node2type)
       else