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 744 - (view) (download)

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 : leunga 744 fun asmEmit(F.CLUSTER{blocks,annotations=an,...}) =
13 : monnier 498 let val E.S.STREAM{pseudoOp,defineLabel,emit,annotation,comment,...} =
14 :     E.makeStream (!an)
15 :     fun emitAn a = if Annotations.toString a = "" then () else annotation(a)
16 : monnier 427 fun emitIt(F.PSEUDO pOp) = pseudoOp pOp
17 :     | emitIt(F.LABEL lab) = defineLabel lab
18 : monnier 469 | emitIt(F.BBLOCK{insns, annotations=a, ...}) =
19 : monnier 498 (app emitAn (!a);
20 : monnier 469 app emit (rev (!insns))
21 :     )
22 : george 545 | emitIt _ = ()
23 : monnier 469 in app annotation (!an);
24 :     app emitIt blocks
25 : monnier 427 end
26 :     end
27 :    

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