aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-26 12:30:43 -0700
committerGraydon Hoare <[email protected]>2010-07-26 12:30:43 -0700
commit1b41d7be1ab43594982361f58e49e2d399ccbfb4 (patch)
tree0fc53e4cd049235a6e0179547fafb29b41f74fd5 /src/boot
parentDo some more iflog-guarding. (diff)
downloadrust-1b41d7be1ab43594982361f58e49e2d399ccbfb4.tar.xz
rust-1b41d7be1ab43594982361f58e49e2d399ccbfb4.zip
Change ctxt_crate_main to an Ast.name.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/me/semant.ml7
-rw-r--r--src/boot/me/trans.ml8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml
index 8196d568..5a3bb5d1 100644
--- a/src/boot/me/semant.ml
+++ b/src/boot/me/semant.ml
@@ -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;
}
;;
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index 832ccd1f..4bf974b2 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -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;