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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/emit/clusterEmit.sml

1 : monnier 427 (*
2 :     * This module takes a flowgraph and an assembly emitter module and
3 :     * ties them together into one. The output is sent to AsmStream.
4 :     * --Allen
5 :     *)
6 :     functor ClusterEmit
7 :     (structure F : FLOWGRAPH
8 :     structure E : INSTRUCTION_EMITTER
9 :     where I = F.I and P = F.P) : ASSEMBLY_EMITTER =
10 :     struct
11 :     type flowgraph = F.cluster
12 : monnier 469 fun asmEmit(F.CLUSTER{blocks,regmap,annotations=an,...}) =
13 :     let val E.S.STREAM{pseudoOp,defineLabel,emit,annotation,...} =
14 :     E.makeStream []
15 : monnier 427 val emit = emit(E.I.C.lookup regmap)
16 :     fun emitIt(F.PSEUDO pOp) = pseudoOp pOp
17 :     | emitIt(F.LABEL lab) = defineLabel lab
18 : monnier 469 | emitIt(F.BBLOCK{insns, annotations=a, ...}) =
19 :     (app annotation (!a);
20 :     app emit (rev (!insns))
21 :     )
22 :     in app annotation (!an);
23 :     app emitIt blocks
24 : monnier 427 end
25 :     end
26 :    

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