diff options
Diffstat (limited to 'driver')
-rw-r--r-- | driver/errors.ml | 3 | ||||
-rw-r--r-- | driver/opterrors.ml | 33 | ||||
-rw-r--r-- | driver/optmain.ml | 4 |
3 files changed, 8 insertions, 32 deletions
diff --git a/driver/errors.ml b/driver/errors.ml index cb1a047ec..bda1a30ac 100644 --- a/driver/errors.ml +++ b/driver/errors.ml @@ -10,4 +10,7 @@ (* *) (***********************************************************************) +(* This module should be removed. We keep it for now, to avoid + breaking external tools depending on it. *) + let report_error = Location.report_exception diff --git a/driver/opterrors.ml b/driver/opterrors.ml index 68279bff6..bda1a30ac 100644 --- a/driver/opterrors.ml +++ b/driver/opterrors.ml @@ -10,34 +10,7 @@ (* *) (***********************************************************************) -(* WARNING: if you change something in this file, you must look at - errors.ml to see if you need to make the same changes there. -*) +(* This module should be removed. We keep it for now, to avoid + breaking external tools depending on it. *) -open Format - -(* Report an error *) - -let report_error ppf exn = - let report ppf = function - | Compilenv.Error code -> - Location.print_error_cur_file ppf; - Compilenv.report_error ppf code - | Asmgen.Error code -> - Location.print_error_cur_file ppf; - Asmgen.report_error ppf code - | Asmlink.Error code -> - Location.print_error_cur_file ppf; - Asmlink.report_error ppf code - | Asmlibrarian.Error code -> - Location.print_error_cur_file ppf; - Asmlibrarian.report_error ppf code - | Asmpackager.Error code -> - Location.print_error_cur_file ppf; - Asmpackager.report_error ppf code - | x -> - match Location.error_of_exn x with - | Some err -> Location.report_error ppf err - | None -> fprintf ppf "@]"; raise x - in - fprintf ppf "@[%a@]@." report exn +let report_error = Location.report_exception diff --git a/driver/optmain.ml b/driver/optmain.ml index 45bdec244..9f973f2b1 100644 --- a/driver/optmain.ml +++ b/driver/optmain.ml @@ -201,7 +201,7 @@ let main () = end; exit 0 with x -> - Opterrors.report_error ppf x; - exit 2 + Location.report_exception ppf x; + exit 2 let _ = main () |