Skip to content

Commit 1b41d7b

Browse files
committed
Change ctxt_crate_main to an Ast.name.
1 parent 025b1e4 commit 1b41d7b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Diff for: src/boot/me/semant.ml

+2-5
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ type ctxt =
169169
ctxt_required_lib_num: (required_lib, int) Hashtbl.t;
170170

171171
ctxt_main_fn_fixup: fixup option;
172-
ctxt_main_name: string option;
172+
ctxt_main_name: Ast.name option;
173173
}
174174
;;
175175

@@ -254,10 +254,7 @@ let new_ctxt sess abi crate =
254254
None -> None
255255
| Some n -> Some (new_fixup (string_of_name n)));
256256

257-
ctxt_main_name =
258-
(match crate.Ast.crate_main with
259-
None -> None
260-
| Some n -> Some (string_of_name n));
257+
ctxt_main_name = crate.Ast.crate_main;
261258
}
262259
;;
263260

Diff for: src/boot/me/trans.ml

+5-3
Original file line numberDiff line numberDiff line change
@@ -5313,7 +5313,7 @@ let fixup_assigning_visitor
53135313

53145314
| Ast.MOD_ITEM_fn _ ->
53155315
begin
5316-
let path = path_name () in
5316+
let path = path_to_name path in
53175317
let fixup =
53185318
if (not cx.ctxt_sess.Session.sess_library_mode)
53195319
&& (Some path) = cx.ctxt_main_name
@@ -5322,7 +5322,7 @@ let fixup_assigning_visitor
53225322
None -> bug () "missing main fixup in trans"
53235323
| Some fix -> fix
53245324
else
5325-
new_fixup path
5325+
new_fixup (path_name())
53265326
in
53275327
htab_put cx.ctxt_fn_fixups i.id fixup;
53285328
end
@@ -5390,7 +5390,9 @@ let process_crate
53905390
begin
53915391
match cx.ctxt_main_name with
53925392
None -> ()
5393-
| Some m -> log cx "with main fn %s" m
5393+
| Some m ->
5394+
log cx "with main fn %a"
5395+
Ast.sprintf_name m
53945396
end;
53955397
run_passes cx "trans" path passes
53965398
cx.ctxt_sess.Session.sess_log_trans log crate;

0 commit comments

Comments
 (0)