summaryrefslogtreecommitdiffstats
path: root/asmcomp/compilenv.ml
diff options
context:
space:
mode:
Diffstat (limited to 'asmcomp/compilenv.ml')
-rw-r--r--asmcomp/compilenv.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/asmcomp/compilenv.ml b/asmcomp/compilenv.ml
index 280b13127..48d6be7d4 100644
--- a/asmcomp/compilenv.ml
+++ b/asmcomp/compilenv.ml
@@ -245,3 +245,10 @@ let report_error ppf = function
fprintf ppf "%a@ contains the description for unit\
@ %s when %s was expected"
Location.print_filename filename name modname
+
+let () =
+ Location.register_error_of_exn
+ (function
+ | Error err -> Some (Location.error_of_printer_file report_error err)
+ | _ -> None
+ )