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.
This commit is contained in:
parent
f9f45c6dac
commit
7d06bdd4a1
1 changed files with 3 additions and 0 deletions
|
@ -1196,6 +1196,9 @@ pub fn maybe_create_entry_wrapper(ccx: &CrateContext) {
|
||||||
}
|
}
|
||||||
let llfn = declare::declare_cfn(ccx, "main", llfty);
|
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 {
|
let llbb = unsafe {
|
||||||
llvm::LLVMAppendBasicBlockInContext(ccx.llcx(), llfn, "top\0".as_ptr() as *const _)
|
llvm::LLVMAppendBasicBlockInContext(ccx.llcx(), llfn, "top\0".as_ptr() as *const _)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue