Module ClangFrontend.CFrontend_errors

type exception_details = {
msg : string;
position : IBase.Logging.ocaml_pos;
source_range : ATDGenerated.Clang_ast_t.source_range;
ast_node : string option;
}
exception Unimplemented of exception_details
exception IncorrectAssumption of exception_details
exception Invalid_declaration
val unimplemented : IBase.Logging.ocaml_pos -> ATDGenerated.Clang_ast_t.source_range -> ?⁠ast_node:string -> ('a, Stdlib.Format.formatter, unit, _) IStdlib.IStd.format4 -> 'a

Raise Unimplemented. This is caught at the level of translating a method and makes the frontend give up on that method.

val incorrect_assumption : IBase.Logging.ocaml_pos -> ATDGenerated.Clang_ast_t.source_range -> ?⁠ast_node:string -> ('a, Stdlib.Format.formatter, unit, _) IStdlib.IStd.format4 -> 'a

Used to mark places in the frontend that incorrectly assume something to be impossible. TODO(t21762295) get rid of all instances of this.

val protect : f:(unit -> unit) -> recover:(unit -> unit) -> pp_context:(Stdlib.Format.formatter -> unit -> unit) -> unit

Catch frontend errors in f to avoid crashing due to bugs in the frontend. Upon error recover is run and pp_context is used to provide more info to the user.