Skip to content

Commit

Permalink
Rollup merge of rust-lang#37556 - dinfuehr:main_frame_pointer, r=eddyb
Browse files Browse the repository at this point in the history
set frame pointer elimination attribute for main

The rustc-generated function `main` should respect the same config for
frame pointer elimination as the rest of code.
  • Loading branch information
alexcrichton committed Nov 4, 2016
2 parents 3c80579 + 7d06bdd commit 0bcd5c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustc_trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,9 @@ pub fn maybe_create_entry_wrapper(ccx: &CrateContext) {
}
let llfn = declare::declare_cfn(ccx, "main", llfty);

// `main` should respect same config for frame pointer elimination as rest of code
attributes::set_frame_pointer_elimination(ccx, llfn);

let llbb = unsafe {
llvm::LLVMAppendBasicBlockInContext(ccx.llcx(), llfn, "top\0".as_ptr() as *const _)
};
Expand Down

0 comments on commit 0bcd5c0

Please sign in to comment.