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. --- cparser/ExtendedAsm.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cparser/ExtendedAsm.ml') diff --git a/cparser/ExtendedAsm.ml b/cparser/ExtendedAsm.ml index 30d1a0cc..6cd95aec 100644 --- a/cparser/ExtendedAsm.ml +++ b/cparser/ExtendedAsm.ml @@ -33,7 +33,7 @@ open Printf open Machine open C open Cutil -open Cerrors +open Diagnostics (* Renaming of labeled and numbered operands *) @@ -176,7 +176,7 @@ let rename_placeholders loc template subst = try StringMap.find p subst with Not_found -> - error loc"'%s' in asm text does not designate any operand" p; + error loc "'%s' in asm text does not designate any operand" p; "%" in Str.global_substitute re_asm_placeholder -- cgit