From 62522def7409a233f5316546cd6bee91e812a039 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 20 Jul 2010 13:55:56 -0700 Subject: Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2". --- src/boot/me/semant.ml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/boot/me/semant.ml') diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 1992bf93..41d28d32 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -261,23 +261,10 @@ let new_ctxt sess abi crate = } ;; -let report_err cx ido str = - let sess = cx.ctxt_sess in - let spano = match ido with - None -> None - | Some id -> (Session.get_span sess id) - in - match spano with - None -> - Session.fail sess "Error: %s\n%!" str - | Some span -> - Session.fail sess "%s:E:Error: %s\n%!" - (Session.string_of_span span) str -;; let bugi (cx:ctxt) (i:node_id) = let k s = - report_err cx (Some i) s; + Session.report_err cx.ctxt_sess (Some i) s; failwith s in Printf.ksprintf k ;; @@ -1857,7 +1844,8 @@ let run_passes Session.time_inner name sess (fun _ -> Array.iteri do_pass passes) with - Semant_err (ido, str) -> report_err cx ido str + Semant_err (ido, str) -> + Session.report_err cx.ctxt_sess ido str ;; (* Rust type -> IL type conversion. *) -- cgit v1.2.3