Module Checker.Typecheck
the module that performs type checking (not borrow checking) and convert a source program into the ANF IR. This module also defines a data structure holding source information that link IR values to their source in the surface syntax. See Typecheck.type_info
type type_info={block_typs : (IR.label, string * Syntax.typ option) Stdlib.Hashtbl.t;functions : (string, Syntax.function_typ) Stdlib.Hashtbl.t;variables : (IR.variable, IR.source * IR.var_kind) Stdlib.Hashtbl.t;}block_typscontains the type of the parameters of blocks in the IR. It also contains a short string description for every block.functionscontains the syntactic type of every functionvariablescontains, for each IR variable:- the source expression it corresponds to
- whether it is temporary or not (see
IR.var_kind)
val make_type_info : unit -> type_infoval check_function : type_info -> Syntax.function_def -> IR.function_def