Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/flowgraph/cfg.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/flowgraph/cfg.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1117, Wed Mar 6 15:29:24 2002 UTC revision 1118, Wed Mar 6 15:30:25 2002 UTC
# Line 317  Line 317 
317                (String.tokens (fn #" " => true | _ => false) text)                (String.tokens (fn #" " => true | _ => false) text)
318            end            end
319    
320      fun dump (outS, title, cfg as G.GRAPH g) = let      fun dumpBlock (outS, cfg as G.GRAPH g) = let
321            fun pr str = TextIO.output(outS, str)            fun pr str = TextIO.output(outS, str)
322            fun prList [] = ()            fun prList [] = ()
323              | prList [i] = pr i              | prList [i] = pr i
324              | prList (h::t) = (pr (h ^ ", "); prList t)              | prList (h::t) = (pr (h ^ ", "); prList t)
325            val annotations = !(annotations cfg)            val Asm.S.STREAM{emit,defineLabel,annotation,...} =
326            val Asm.S.STREAM{emit,pseudoOp,defineLabel,annotation,...} =                  AsmStream.withStream outS Asm.makeStream []
                 AsmStream.withStream outS Asm.makeStream annotations  
327            fun showFreq (ref w) = F.format "[%s]" [F.STR(W.toString w)]            fun showFreq (ref w) = F.format "[%s]" [F.STR(W.toString w)]
328            fun showEdge (blknum,e) =            fun showEdge (blknum,e) =
329                  F.format "%d:%s" [F.INT blknum, F.STR(show_edge e)]                  F.format "%d:%s" [F.INT blknum, F.STR(show_edge e)]
# Line 349  Line 348 
348                ) = (                ) = (
349                 pr (F.format "BLOCK %d %s\n" [F.INT id, F.STR(showFreq freq)]);                 pr (F.format "BLOCK %d %s\n" [F.INT id, F.STR(showFreq freq)]);
350                 case !align of NONE => () | SOME p => (pr (P.toString p ^ "\n"));                 case !align of NONE => () | SOME p => (pr (P.toString p ^ "\n"));
351                 app annotation (!annotations);                 List.app annotation (!annotations);
352                 app defineLabel (!labels);                 List.app defineLabel (!labels);
353                 showSuccs id;                 showSuccs id;
354                 showPreds id;                 showPreds id;
355                 List.app emit (List.rev (!insns)))                 List.app emit (List.rev (!insns)))
356              in
357                printBlock
358              end
359    
360        fun dump (outS, title, cfg as G.GRAPH g) = let
361              fun pr str = TextIO.output(outS, str)
362              val annotations = !(annotations cfg)
363              val Asm.S.STREAM{annotation, ...} =
364                    AsmStream.withStream outS Asm.makeStream annotations
365            fun printData () = let            fun printData () = let
366                  val INFO{data, ...} = #graph_info g                  val INFO{data, ...} = #graph_info g
367                  in                  in
# Line 363  Line 371 
371              pr(F.format "[ %s ]\n" [F.STR title]);              pr(F.format "[ %s ]\n" [F.STR title]);
372              List.app annotation annotations;              List.app annotation annotations;
373              (* printBlock entry; *)              (* printBlock entry; *)
374              AsmStream.withStream outS (#forall_nodes g) printBlock;              AsmStream.withStream outS (#forall_nodes g) (dumpBlock (outS, cfg));
375              (* printBlock exit; *)              (* printBlock exit; *)
376              AsmStream.withStream outS printData ();              AsmStream.withStream outS printData ();
377              TextIO.flushOut outS              TextIO.flushOut outS

Legend:
Removed from v.1117  
changed lines
  Added in v.1118

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0