Debian Codegraph @

lib/mlrisc-lib/MLRISC/emit/asmUtil.sml

raw
1 (*
2 * This is a helper module for assemblers.
3 *)
4 signature ASM_FORMAT_UTIL =
5 sig
6 structure C : CELLS_BASIS
7 val reginfo :
8 (string -> unit) * Annotations.annotations ->
9 (C.cell -> unit)
10 val emit_cutsTo : (string -> unit) -> Label.label list -> unit
11 end
12
13 structure AsmFormatUtil : ASM_FORMAT_UTIL =
14 struct
15
16 structure C = CellsBasis
17 fun reginfo(emit,an) =
18 case #get MLRiscAnnotations.PRINT_CELLINFO an of
19 SOME f => (fn c => emit(f c))
20 | NONE => (fn _ => ())
21 fun emit_cutsTo emit [] = ()
22 | emit_cutsTo emit labels =
23 emit("\n\t/* cuts to:"^
24 List.foldr
25 (fn (l,"") => Label.toString l
26 | (l,s) => Label.toString l^","^s)
27 "" labels^" */\n")
28 end