1 (* Copyright (C) 2009-2012,2014-2017 Matthew Fluet.
2 * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
10 signature CONTROL_FLAGS =
12 (* set all flags to their default values *)
13 val defaults: unit -> unit
15 val all : unit -> {name: string,
18 (*------------------------------------*)
20 (*------------------------------------*)
22 datatype align = Align4 | Align8
25 val atMLtons: string vector ref
30 | Coalesce of {limit: int}
34 val closureConvertGlobalize: bool ref
35 val closureConvertShrink: bool ref
45 val toString: t -> string
48 datatype codegen = datatype Codegen.t
50 val codegen: Codegen.t ref
52 val contifyIntoMain: bool ref
54 (* Generate an executable with debugging info. *)
57 val defaultChar: string ref
58 val defaultWideChar: string ref
59 val defaultInt: string ref
60 val defaultReal: string ref
61 val defaultWord: string ref
63 (* List of pass names to keep diagnostic info on. *)
64 val diagPasses: Regexp.Compiled.t list ref
66 (* List of optimization passes to disable/enable. *)
67 val executePasses: (Regexp.Compiled.t * bool) list ref
84 structure ResolveScope :
95 val document: {expert: bool} -> Layout.t
97 val allowConstant: (bool,bool) t
98 val allowFFI: (bool,bool) t
99 val allowOverload: (bool,bool) t
100 val allowPrim: (bool,bool) t
101 val allowRedefineSpecialIds: (bool,bool) t
102 val allowSpecifySpecialIds: (bool,bool) t
103 val deadCode: (bool,bool) t
104 val forceUsed: (unit,bool) t
105 val ffiStr: (string,string option) t
106 val nonexhaustiveBind: (DiagEIW.t,DiagEIW.t) t
107 val nonexhaustiveExnBind: (DiagDI.t,DiagDI.t) t
108 val redundantBind: (DiagEIW.t,DiagEIW.t) t
109 val nonexhaustiveMatch: (DiagEIW.t,DiagEIW.t) t
110 val nonexhaustiveExnMatch: (DiagDI.t,DiagDI.t) t
111 val redundantMatch: (DiagEIW.t,DiagEIW.t) t
112 val nonexhaustiveRaise: (DiagEIW.t,DiagEIW.t) t
113 val nonexhaustiveExnRaise: (DiagDI.t,DiagDI.t) t
114 val redundantRaise: (DiagEIW.t,DiagEIW.t) t
115 val resolveScope: (ResolveScope.t,ResolveScope.t) t
116 val sequenceNonUnit: (DiagEIW.t,DiagEIW.t) t
117 val valrecConstr: (DiagEIW.t,DiagEIW.t) t
118 val warnUnused: (bool,bool) t
121 val allowDoDecls: (bool,bool) t
122 val allowExtendedNumConsts: (bool,bool) t
123 val allowExtendedTextConsts: (bool,bool) t
124 val allowLineComments: (bool,bool) t
125 val allowOptBar: (bool,bool) t
126 val allowOptSemicolon: (bool,bool) t
127 val allowOrPats: (bool,bool) t
128 val allowRecordPunExps: (bool,bool) t
129 val allowSigWithtype: (bool,bool) t
130 val allowVectorExps: (bool,bool) t
131 val allowVectorPats: (bool,bool) t
133 val current: ('args, 'st) t -> 'st
134 val default: ('args, 'st) t -> 'st
135 val enabled: ('args, 'st) t -> bool
136 val expert: ('args, 'st) t -> bool
137 val name: ('args, 'st) t -> string
139 datatype 'a parseResult =
140 Bad | Good of 'a | Other | Proxy of 'a list * {deprecated: bool}
145 val name: t -> string
147 val equalsId: ('args, 'st) t * Id.t -> bool
148 val parseId: string -> Id.t parseResult
153 val processAnn: t -> (unit -> unit)
155 val parseIdAndArgs: string -> (Id.t * Args.t) parseResult
157 val processDefault: string -> Id.t parseResult
158 val processEnabled: string * bool -> Id.t parseResult
160 val withDef: (unit -> 'a) -> 'a
161 val snapshot: unit -> (unit -> 'a) -> 'a
164 (* stop after elaboration. So, no need for the elaborator to generate
167 val elaborateOnly: bool ref
169 val emitMain: bool ref
171 val exportHeader: File.t option ref
173 val exnHistory: bool ref
183 val toString: t -> string
186 datatype format = datatype Format.t
188 val format: Format.t ref
195 val gcCheck: gcCheck ref
197 (* Indentation used in laying out ILs. *)
198 val indentation: int ref
200 val inlineIntoMain: bool ref
202 val inlineLeafA: {loops: bool, repeat: bool, size: int option} ref
203 val inlineLeafB: {loops: bool, repeat: bool, size: int option} ref
205 val inlineNonRec: {small: int, product: int} ref
207 (* The input file on the command line, minus path and extension. *)
208 val inputFile: File.t ref
210 (* Whether or not the elaborator keeps def-use information. *)
211 val keepDefUse: bool ref
213 (* Keep dot files for whatever SSA files are produced. *)
214 val keepDot: bool ref
216 (* List of pass names to save the input/output. *)
217 val keepPasses: Regexp.Compiled.t list ref
219 (* Save the AST to a file. *)
220 val keepAST: bool ref
221 (* Save the final CoreML to a file. *)
222 val keepCoreML: bool ref
223 (* Save the final Machine to a file. *)
224 val keepMachine: bool ref
225 (* Save the final RSSA to a file. *)
226 val keepRSSA: bool ref
227 (* Save the final SSA to a file. *)
228 val keepSSA: bool ref
229 (* Save the final SSA2 to a file. *)
230 val keepSSA2: bool ref
231 (* Save the final SXML to a file. *)
232 val keepSXML: bool ref
233 (* Save the final XML to a file. *)
234 val keepXML: bool ref
236 (* For the codegen -- do labels for gcc and assembler need an extra leading
239 val labelsHaveExtra_: bool ref
241 (* lib/mlton directory *)
242 val libDir: Dir.t ref
244 (* lib/mlton/target directory *)
245 val libTargetDir: Dir.t ref
247 (* name of the output library *)
248 val libname : string ref
250 (* Number of times to loop through optimization passes. *)
251 val loopSsaPasses: int ref
252 val loopSsa2Passes: int ref
254 (* Limit the code growth loop unrolling/unswitching will allow. *)
255 val loopUnrollLimit: int ref
256 val loopUnswitchLimit: int ref
258 (* Should the mutator mark cards? *)
259 val markCards: bool ref
261 val maxFunctionSize: int ref
263 val mlbPathVars: {var: string,
264 path: string} list ref
265 val mlbPathMap: unit -> {var: string,
270 (* whether or not to use comments in native codegen *)
271 val commented: int ref
273 (* whether or not to track liveness of stack slots *)
274 val liveStack: bool ref
276 (* level of optimization to use in native codegen *)
277 val optimize: int ref
279 (* whether or not to use move hoisting in native codegen *)
280 val moveHoist: bool ref
282 (* whether or not to use copy propagation in native codegen *)
283 val copyProp: bool ref
285 (* Don't use copy propagation on blocks larger than this. *)
286 val copyPropCutoff: int ref
288 (* live transfer cutoff distance *)
291 (* whether or not to use live transfer in native codegen *)
292 val liveTransfer: int ref
294 (* whether or not to shuffle registers around C-calls *)
295 val shuffle: bool ref
297 (* whether or not to use strict IEEE floating-point in native codegen *)
300 (* whether or not to split assembly file in native codegen *)
301 val split: int option ref
304 val optFuel: int option ref
306 val optFuelAvailAndUse: unit -> bool
308 val optimizationPasses:
309 {il: string, set: string -> unit Result.t, get: unit -> string} list ref
311 val positionIndependent : bool ref
313 (* Only duplicate big functions when
314 * (size - small) * (number of occurrences - 1) <= product
324 val preferAbsPaths: bool ref
326 (* List of pass names to keep profiling info on. *)
327 val profPasses: Regexp.Compiled.t list ref
329 (* Insert profiling information. *)
339 val profile: profile ref
341 val profileBranch: bool ref
343 val profileC: Regexp.Compiled.t list ref
345 datatype profileIL = ProfileSource | ProfileSSA | ProfileSSA2
346 val profileIL: profileIL ref
348 val profileInclExcl: (Regexp.Compiled.t * bool) list ref
350 val profileRaise: bool ref
352 val profileStack: bool ref
354 val profileVal: bool ref
356 (* Show the basis library. *)
357 val showBasis: File.t option ref
359 val showBasisCompact: bool ref
360 val showBasisDef: bool ref
361 val showBasisFlat: bool ref
363 (* Show def-use information. *)
364 val showDefUse: File.t option ref
366 (* Should types be printed in ILs. *)
367 val showTypes: bool ref
372 val target: target ref
376 datatype arch = datatype MLton.Platform.Arch.t
379 val bigEndian: unit -> bool
380 val setBigEndian: bool -> unit
382 datatype os = datatype MLton.Platform.OS.t
387 val arrayMetaData: unit -> Bits.t
388 val cint: unit -> Bits.t
389 val cpointer: unit -> Bits.t
390 val cptrdiff: unit -> Bits.t
391 val csize: unit -> Bits.t
392 val header: unit -> Bits.t
393 val mplimb: unit -> Bits.t
394 val normalMetaData: unit -> Bits.t
395 val objptr: unit -> Bits.t
396 val seqIndex: unit -> Bits.t
398 val setSizes: {arrayMetaData: Bits.t,
405 normalMetaData: Bits.t,
407 seqIndex: Bits.t} -> unit
410 (* Type check ILs. *)
411 val typeCheck: bool ref
418 val verbosity: verbosity ref
420 val warnAnn: bool ref
422 val warnDeprecated: bool ref
424 val zoneCutDepth: int ref
426 (*------------------------------------*)
428 (*------------------------------------*)