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/emit/clusterEmit.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/emit/clusterEmit.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (download) (annotate)
Wed Nov 10 22:42:52 1999 UTC (19 years, 11 months ago) by monnier
Original Path: sml/branches/SMLNJ/src/MLRISC/emit/clusterEmit.sml
File size: 823 byte(s)
version 110.23
(*
 * This module takes a flowgraph and an assembly emitter module and 
 * ties them together into one.  The output is sent to AsmStream.
 *  --Allen
 *)
functor ClusterEmit
  (structure F : FLOWGRAPH
   structure E : INSTRUCTION_EMITTER
      where I = F.I and P = F.P) : ASSEMBLY_EMITTER = 
struct
  type flowgraph = F.cluster
  fun asmEmit(F.CLUSTER{blocks,regmap,annotations=an,...}) = 
  let val E.S.STREAM{pseudoOp,defineLabel,emit,annotation,...} = 
             E.makeStream []
      val emit = emit(E.I.C.lookup regmap)
      fun emitIt(F.PSEUDO pOp) = pseudoOp pOp
        | emitIt(F.LABEL lab)  = defineLabel lab
        | emitIt(F.BBLOCK{insns, annotations=a, ...}) = 
          (app annotation (!a);
           app emit (rev (!insns))
          )
  in  app annotation (!an);
      app emitIt blocks
  end
end


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