From 460b92a37ff8b8a913c1d92c4755be66b3cee8aa Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Mon, 9 Apr 2012 12:02:16 +0800 Subject: [PATCH] rustc: Declare rust_start as a function Issue #2167 --- src/rustc/middle/trans/base.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index ed1c95dcd4a..53a088d82aa 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -4497,9 +4497,7 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef, let crate_map = ccx.crate_map; let start_ty = T_fn([val_ty(rust_main), ccx.int_type, ccx.int_type, val_ty(crate_map)], ccx.int_type); - let start = str::as_c_str("rust_start", {|buf| - llvm::LLVMAddGlobal(ccx.llmod, start_ty, buf) - }); + let start = decl_cdecl_fn(ccx.llmod, "rust_start", start_ty); let args = [rust_main, llvm::LLVMGetParam(llfn, 0 as c_uint), llvm::LLVMGetParam(llfn, 1 as c_uint), crate_map]; let result = unsafe {