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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 906 - (download) (annotate)
Fri Aug 24 17:36:40 2001 UTC (18 years, 2 months ago) by george
File size: 684 byte(s)
Initial revision
signature DUMP_CFG = sig
  structure CFG : CONTROL_FLOW_GRAPH

  val dumpCFG : TextIO.outstream -> string *  CFG.cfg -> unit
end



functor DumpCFG
  ( structure CFG : CONTROL_FLOW_GRAPH
    structure Asm : INSTRUCTION_EMITTER
		where P=CFG.P
		  and I = CFG.I
   ) : DUMP_CFG = 
struct

  val Asm.S.STREAM{emit, pseudoOp, comment, ...} = Asm.makeStream []

  structure CFG = CFG

  fun dumpCFG outStrm (text, cfg as Graph.GRAPH graph) = let
    fun dumpData 
    fun dumpNode(nid, CFG.BLOCK{data, insns, ...}) = 
      (app dumpData (!data); app emit insns)
      

  in
    comment text;
    AsmStream.withStream outStrm 
      (fn () => (#forall_nodes graph dumpNode)) ()
  end
end

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