diff options
| author | Graydon Hoare <[email protected]> | 2010-07-20 13:55:56 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-20 13:55:56 -0700 |
| commit | 62522def7409a233f5316546cd6bee91e812a039 (patch) | |
| tree | 5ac4085ee755b9c83bdd378d6460d4a57ebb0846 /src/boot/me | |
| parent | Re-XFAIL stuff that is definitely still unsupported in LLVM-land (like, throw... (diff) | |
| download | rust-62522def7409a233f5316546cd6bee91e812a039.tar.xz rust-62522def7409a233f5316546cd6bee91e812a039.zip | |
Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2".
Diffstat (limited to 'src/boot/me')
| -rw-r--r-- | src/boot/me/semant.ml | 18 | ||||
| -rw-r--r-- | src/boot/me/type.ml | 17 |
2 files changed, 11 insertions, 24 deletions
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. *) diff --git a/src/boot/me/type.ml b/src/boot/me/type.ml index ddb9608b..005db095 100644 --- a/src/boot/me/type.ml +++ b/src/boot/me/type.ml @@ -950,15 +950,14 @@ let process_crate (cx:Semant.ctxt) (crate:Ast.crate) : unit = } in - try - Walk.walk_crate - (Walk.path_managing_visitor path - (Semant.mod_item_logging_visitor - cx - cx.Semant.ctxt_sess.Session.sess_log_type log 0 path - (visitor cx Walk.empty_visitor))) - crate - with Common.Semant_err (ido, str) -> Semant.report_err cx ido str; + let passes = + [| + (visitor cx Walk.empty_visitor) + |] + in + let log_flag = cx.Semant.ctxt_sess.Session.sess_log_type in + Semant.run_passes cx "type" path passes log_flag log crate +;; (* * Local Variables: |