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
Jonathan Turner authored Nov 4, 2016
2 parents c5752f0 + 7d06bdd commit be98e20
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 be98e20

Please sign in to comment.