Module Linkdeps
module Linkdeps: sig .. end
type t
The state of the linking check. It keeps track of compilation units provided and required so far.
type compunit = string
type filename = string
val create : complete:bool -> t
create ~complete returns an empty state. If complete is true, missing compilation units will be treated as errors.
val add : t -> filename:filename -> compunit:compunit -> provides:compunit list -> requires:compunit list -> unit
add t ~filename ~compunit ~provides ~requires registers the compilation unit compunit found in filename to t.
-
providesare units and sub-units provided bycompunit -
requiresare units required bycompunit
add should be called in reverse topological order.
val required : t -> compunit -> bool
required t compunit returns true if compunit is a dependency of previously added compilation units.
type compunit_and_source = {
compunit :
| |
filename :
|
} type error =
|
| Missing_implementations of
|
|
| Wrong_link_order of
|
|
| Multiple_definitions of
|
val check : t -> error option
check t should be called once all the compilation units to be linked have been added. It returns some error if:
- There are some missing implementations and
completeistrue - Some implementation appear before their dependencies
val report_error : print_filename:string Format_doc.printer -> error Format_doc.format_printer
val report_error_doc : print_filename:string Format_doc.printer -> error Format_doc.printer
© 1995-2024 INRIA.
https://ocaml.org/manual/5.3/api/compilerlibref/Linkdeps.html