Change ctxt_crate_main to an Ast.name.
This commit is contained in:
parent
025b1e4133
commit
1b41d7be1a
@ -169,7 +169,7 @@ type ctxt =
|
||||
ctxt_required_lib_num: (required_lib, int) Hashtbl.t;
|
||||
|
||||
ctxt_main_fn_fixup: fixup option;
|
||||
ctxt_main_name: string option;
|
||||
ctxt_main_name: Ast.name option;
|
||||
}
|
||||
;;
|
||||
|
||||
@ -254,10 +254,7 @@ let new_ctxt sess abi crate =
|
||||
None -> None
|
||||
| Some n -> Some (new_fixup (string_of_name n)));
|
||||
|
||||
ctxt_main_name =
|
||||
(match crate.Ast.crate_main with
|
||||
None -> None
|
||||
| Some n -> Some (string_of_name n));
|
||||
ctxt_main_name = crate.Ast.crate_main;
|
||||
}
|
||||
;;
|
||||
|
||||
|
@ -5313,7 +5313,7 @@ let fixup_assigning_visitor
|
||||
|
||||
| Ast.MOD_ITEM_fn _ ->
|
||||
begin
|
||||
let path = path_name () in
|
||||
let path = path_to_name path in
|
||||
let fixup =
|
||||
if (not cx.ctxt_sess.Session.sess_library_mode)
|
||||
&& (Some path) = cx.ctxt_main_name
|
||||
@ -5322,7 +5322,7 @@ let fixup_assigning_visitor
|
||||
None -> bug () "missing main fixup in trans"
|
||||
| Some fix -> fix
|
||||
else
|
||||
new_fixup path
|
||||
new_fixup (path_name())
|
||||
in
|
||||
htab_put cx.ctxt_fn_fixups i.id fixup;
|
||||
end
|
||||
@ -5390,7 +5390,9 @@ let process_crate
|
||||
begin
|
||||
match cx.ctxt_main_name with
|
||||
None -> ()
|
||||
| Some m -> log cx "with main fn %s" m
|
||||
| Some m ->
|
||||
log cx "with main fn %a"
|
||||
Ast.sprintf_name m
|
||||
end;
|
||||
run_passes cx "trans" path passes
|
||||
cx.ctxt_sess.Session.sess_log_trans log crate;
|
||||
|
Loading…
Reference in New Issue
Block a user