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

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