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/extensions/code-emitter.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/extensions/code-emitter.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 246 - (view) (download)

1 : monnier 245 (*
2 :     * This is an abstract interface for generating assembly, or machine code.
3 :     * It is also used by the front-end to generate code for the back-end.
4 :     * Unlike the signature EMITTER_NEW or FLOWGRAPH_GEN, this one is not
5 :     * tied into any form of flowgraph representation.
6 :     *)
7 :    
8 :     functor CodeEmitterFn
9 :     (structure I : INSTRUCTIONS
10 :     structure P : PSEUDO_OPS
11 :     structure B : BLOCK_NAMES
12 :     ) : CODE_EMITTER =
13 :     struct
14 :    
15 :     structure I = I
16 :     structure C = I.C
17 :     structure P = P
18 :     structure B = B
19 :    
20 :     type emitter =
21 :     { defineLabel : Label.label -> unit, (* internal labels *)
22 :     entryLabel : Label.label -> unit, (* external labels *)
23 :     exitBlock : C.cellset -> unit, (* escaping exit *)
24 :     pseudoOp : P.pseudo_op -> unit, (* emit pseudo ops *)
25 :     emitInstr : I.instruction -> unit, (* emit an instruction *)
26 :     blockName : B.name -> unit, (* change the block name *)
27 :     comment : string -> unit, (* emit a comment *)
28 :     init : int -> unit,
29 :     (* initialize (n bytes if for machine code) *)
30 :     finish : unit -> unit (* finish and clean up *)
31 :     }
32 :    
33 :     end
34 :    
35 :     (*
36 :     * $Log$
37 :     *)

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