From f02f00a01b598567f70e138c144d9581973802e6 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 8 Feb 2018 16:38:54 +0100 Subject: Refactor the handling of errors and warnings (#44) * Module Cerrors is now called Diagnostic and can be used in parts of CompCert other than cparser/ * Replaced eprintf error. Instead of having eprintf msg; exit 2 use the functions from the Diagnostics module. * Raise on error before calling external tools. * Added diagnostics to clightgen. * Fix error handling of AsmToJson. * Cleanup error handling of Elab and C2C. *The implementation of location printing (file & line) is simplified and correctly prints valid filenames with invalid lines. --- driver/Linker.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'driver/Linker.ml') diff --git a/driver/Linker.ml b/driver/Linker.ml index 37a5cde0..6e6ad6b4 100644 --- a/driver/Linker.ml +++ b/driver/Linker.ml @@ -19,6 +19,7 @@ open Driveraux (* Linking *) let linker exe_name files = + Diagnostics.raise_on_errors (); let cmd = List.concat [ Configuration.linker; ["-o"; exe_name]; @@ -29,8 +30,7 @@ let linker exe_name files = ] in let exc = command cmd in if exc <> 0 then begin - command_error "linker" exc; - exit 2 + command_error "linker" exc end -- cgit