Disable FP elimination in funcs using 32-bit MSVC EH personalities

The value in 'ebp' acts as an implicit argument to the outlined
handlers, and is recovered with frameaddress(1).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2015-05-29 21:58:11 +00:00
parent cfac75ad0e
commit f0e3e4cd84
3 changed files with 34 additions and 23 deletions

View File

@@ -155,6 +155,11 @@ bool WinEHStatePass::runOnFunction(Function &F) {
if (!isMSVCEHPersonality(Personality))
return false;
// Disable frame pointer elimination in this function.
// FIXME: Do the nested handlers need to keep the parent ebp in ebp, or can we
// use an arbitrary register?
F.addFnAttr("no-frame-pointer-elim", "true");
emitExceptionRegistrationRecord(&F);
auto *MMIPtr = getAnalysisIfAvailable<MachineModuleInfo>();