Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / mlton / backend / rep-type.sig
1 (* Copyright (C) 2014,2017 Matthew Fluet.
2 * Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature REP_TYPE_STRUCTS =
10 sig
11 structure CFunction: C_FUNCTION
12 structure CType: C_TYPE
13 structure Label: LABEL
14 structure ObjptrTycon: OBJPTR_TYCON
15 structure Prim: PRIM
16 structure RealSize: REAL_SIZE
17 structure Runtime: RUNTIME
18 structure Scale: SCALE
19 structure WordSize: WORD_SIZE
20 structure WordX: WORD_X
21 structure WordXVector: WORD_X_VECTOR
22 sharing CFunction = Prim.CFunction
23 sharing RealSize = Prim.RealSize
24 sharing WordSize = Prim.WordSize = WordX.WordSize
25 sharing WordX = WordXVector.WordX
26 end
27
28 signature REP_TYPE =
29 sig
30 include REP_TYPE_STRUCTS
31
32 structure ObjectType: OBJECT_TYPE
33 type t
34 sharing type t = ObjectType.ty
35
36 val bogusWord: t -> WordX.t
37 val align: t * Bytes.t -> Bytes.t
38 val arrayOffsetIsOk: {base: t,
39 index: t,
40 offset: Bytes.t,
41 tyconTy: ObjptrTycon.t -> ObjectType.t,
42 result: t,
43 scale: Scale.t} -> bool
44 val bits: Bits.t -> t
45 val bool: t
46 val bytes: t -> Bytes.t
47 val castIsOk: {from: t,
48 to: t,
49 tyconTy: ObjptrTycon.t -> ObjectType.t} -> bool
50 val checkPrimApp: {args: t vector,
51 prim: t Prim.t,
52 result: t option} -> bool
53 val cpointer: unit -> t
54 val csize: unit -> t
55 val cint: unit -> t
56 val compareRes: t
57 val deLabel: t -> Label.t option
58 val deObjptr: t -> ObjptrTycon.t option
59 val deReal: t -> RealSize.t option
60 val deSeq: t -> t vector option
61 val deWord: t -> WordSize.t option
62 val equals: t * t -> bool
63 val exnStack: unit -> t
64 val gcState: unit -> t
65 val exists: t * (t -> bool) -> bool
66 val intInf: unit -> t
67 val isCPointer: t -> bool
68 val isObjptr: t -> bool
69 val isUnit: t -> bool
70 val isSubtype: t * t -> bool
71 val label: Label.t -> t
72 val layout: t -> Layout.t
73 val name: t -> string (* simple one letter abbreviation *)
74 val ofGCField: Runtime.GCField.t -> t
75 val ofWordXVector: WordXVector.t -> t
76 val ofWordX: WordX.t -> t
77 val offsetIsOk: {base: t,
78 offset: Bytes.t,
79 tyconTy: ObjptrTycon.t -> ObjectType.t,
80 result: t} -> bool
81 val objptr: ObjptrTycon.t -> t
82 val objptrHeader: unit -> t
83 val real: RealSize.t -> t
84 val resize: t * Bits.t -> t
85 val seq: t vector -> t
86 val seqIndex: unit -> t
87 val shiftArg: t
88 val string: unit -> t
89 val sum: t vector -> t
90 val thread: unit -> t
91 val toCType: t -> CType.t
92 val unit: t
93 val width: t -> Bits.t
94 val word: WordSize.t -> t
95 val wordVector: WordSize.t -> t
96 val zero: Bits.t -> t
97
98 structure BuiltInCFunction:
99 sig
100 val bug: unit -> t CFunction.t
101 val gc: {maySwitchThreads: bool} -> t CFunction.t
102 end
103 end