GoblintCil.Errormsg
Utility functions for error-reporting
val error : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Prints an error message of the form Error: ...
. Use in conjunction with s, for example: E.s (E.error ... )
.
val bug : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Similar to error
except that its output has the form Bug: ...
val unimp : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Similar to error
except that its output has the form Unimplemented: ...
This is set whenever one of the above error functions are called. It must be cleared manually
val warn : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Like Errormsg.error
but does not raise the Errormsg.Error
exception. Return type is unit.
val warnOpt : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Like Errormsg.warn
but optional. Printed only if the Errormsg.warnFlag
is set
val log : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Print something to logChannel
val logg : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
same as Errormsg.log
but do not wrap lines
val null : ('a, unit, Pretty.doc, unit) Stdlib.format4 -> 'a
Do not actually print (i.e. print to /dev/null)
val pushContext : (unit -> Pretty.doc) -> unit
Registers a context printing function
val withContext : (unit -> Pretty.doc) -> ('a -> 'b) -> 'a -> 'b
To ensure that the context is registered and removed properly, use the function below
type location = {
file : string;
The file name
*)line : int;
The line number
*)hfile : string;
The high-level file name, or "" if not present
*)hline : int;
The high-level line number, or 0 if not present
*)}
Type for source-file locations
val d_loc : unit -> location -> Pretty.doc
val d_hloc : unit -> location -> Pretty.doc
val getLocation : unit -> location
val locUnknown : location
An unknown location for use when you need one but you don't have one