Debian Codegraph @

lib/mlrisc-lib/MLRISC/instructions/stream.sig

raw
1 (*
2 * This is a generic instruction stream datatype.
3 * Components such as assemblers, machine code emitters, instruction
4 * selection modules communicate with each via this interface.
5 *
6 * -- Allen
7 *)
8
9 signature INSTRUCTION_STREAM =
10 sig
11
12 structure P : PSEUDO_OPS
13 datatype ('a,'b,'c,'d) stream =
14 STREAM of
15 { beginCluster: int -> unit, (* start new compilation unit *)
16 endCluster : 'b -> 'd, (* end compilation unit *)
17 emit : 'a -> unit, (* emit instruction *)
18 pseudoOp : P.pseudo_op -> unit, (* emit a pseudo op *)
19 defineLabel : Label.label -> unit, (* define a local label *)
20 entryLabel : Label.label -> unit, (* define an external label *)
21 comment : string -> unit, (* emit comment *)
22 annotation : Annotations.annotation -> unit, (* add annotation *)
23 getAnnotations: unit -> Annotations.propList ref, (* get annotations*)
24 exitBlock : 'c -> unit (* mark the end of a procedure *)
25 }
26
27 (* Note:
28 o Each compilation unit should be wrapped between beginCluster/endCluster.
29
30 o The method annotation adds an annotation to the current basic block,
31 not to the current instruction.
32
33 o The method comment add a comment to the current basic block.
34 Usually comment(msg) is the same as
35 annotation(BasicAnnotations.COMMENT msg).
36 *)
37
38 end