about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominik Inführ <dominik.infuehr@gmail.com>2016-11-03 10:53:13 +0100
committerDominik Inführ <dominik.infuehr@gmail.com>2016-11-03 10:59:32 +0100
commit7d06bdd4a148ccb924cd6628a94ca8bc0d3611fb (patch)
treeeb26211ea48b31d27ae9f4d1b0ec301e7e76ab08
parentf9f45c6dacd0f0d0a44473931291a4fa6bbb4ddc (diff)
downloadrust-7d06bdd4a148ccb924cd6628a94ca8bc0d3611fb.tar.gz
rust-7d06bdd4a148ccb924cd6628a94ca8bc0d3611fb.zip
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.
-rw-r--r--src/librustc_trans/base.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
index 977ababbf56..47b6fdc740a 100644
--- a/src/librustc_trans/base.rs
+++ b/src/librustc_trans/base.rs
@@ -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 _)
         };