Add logging to type and effect.

This commit is contained in:
Graydon Hoare 2010-06-30 00:53:33 -07:00
parent 2a1d88ae00
commit 861423989d
2 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,11 @@ let mutability_checking_visitor
in in
let check_write s dst = let check_write s dst =
let _ =
iflog cx
(fun _ -> log cx "checking write to lval #%d = %a"
(int_of_node (lval_base_id dst)) Ast.sprintf_lval dst)
in
let dst_ty = lval_ty cx dst in let dst_ty = lval_ty cx dst in
let is_mutable = let is_mutable =
match dst_ty with match dst_ty with

View File

@ -1405,6 +1405,13 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
let record_lval_ty id tv = let record_lval_ty id tv =
let ty = get_resolved_ty tv id in let ty = get_resolved_ty tv id in
let _ =
iflog cx
(fun _ ->
log cx "recording resolved lval #%d type %a"
(int_of_node id)
Ast.sprintf_ty ty)
in
Hashtbl.add cx.ctxt_all_lval_types id ty Hashtbl.add cx.ctxt_all_lval_types id ty
in in