Skip to content

librustc: Allow intra-crate start functions, for runtimeless operation. #6741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2329,9 +2329,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
llvm::LLVMPositionBuilderAtEnd(bld, llbb);

let start_def_id = ccx.tcx.lang_items.start_fn();
if start_def_id.crate == ast::local_crate {
ccx.sess.bug("start lang item is never in the local crate")
} else {
if start_def_id.crate != ast::local_crate {
let start_fn_type = csearch::get_type(ccx.tcx,
start_def_id).ty;
trans_external_path(ccx, start_def_id, start_fn_type);
Expand All @@ -2348,8 +2346,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
let (start_fn, args) = if use_start_lang_item {
let start_def_id = ccx.tcx.lang_items.start_fn();
let start_fn = if start_def_id.crate == ast::local_crate {
ccx.sess.bug("start lang item is never in the local \
crate")
get_item_val(ccx, start_def_id.node)
} else {
let start_fn_type = csearch::get_type(ccx.tcx,
start_def_id).ty;
Expand Down