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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/flowgraph/dumpCFG.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/flowgraph/dumpCFG.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 906 - (view) (download)

1 : george 906 signature DUMP_CFG = sig
2 :     structure CFG : CONTROL_FLOW_GRAPH
3 :    
4 :     val dumpCFG : TextIO.outstream -> string * CFG.cfg -> unit
5 :     end
6 :    
7 :    
8 :    
9 :     functor DumpCFG
10 :     ( structure CFG : CONTROL_FLOW_GRAPH
11 :     structure Asm : INSTRUCTION_EMITTER
12 :     where P=CFG.P
13 :     and I = CFG.I
14 :     ) : DUMP_CFG =
15 :     struct
16 :    
17 :     val Asm.S.STREAM{emit, pseudoOp, comment, ...} = Asm.makeStream []
18 :    
19 :     structure CFG = CFG
20 :    
21 :     fun dumpCFG outStrm (text, cfg as Graph.GRAPH graph) = let
22 :     fun dumpData
23 :     fun dumpNode(nid, CFG.BLOCK{data, insns, ...}) =
24 :     (app dumpData (!data); app emit insns)
25 :    
26 :    
27 :     in
28 :     comment text;
29 :     AsmStream.withStream outStrm
30 :     (fn () => (#forall_nodes graph dumpNode)) ()
31 :     end
32 :     end

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