diff options
author | Dale Johannesen <dalej@apple.com> | 2008-03-31 23:40:23 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-03-31 23:40:23 +0000 |
commit | 1544e4713be68edcf042de5aed7265dff7169d9d (patch) | |
tree | 21bb1802da1e2ff5e6c426b200ee4f75f87cb0c0 /lib/Target/X86/X86RegisterInfo.cpp | |
parent | 1d3863fdbcc37f98d72408b59f6aef3243f36d7f (diff) | |
download | llvm-1544e4713be68edcf042de5aed7265dff7169d9d.tar.gz llvm-1544e4713be68edcf042de5aed7265dff7169d9d.tar.bz2 llvm-1544e4713be68edcf042de5aed7265dff7169d9d.tar.xz |
Emit exception handling info for functions which are
not marked nounwind, or for all functions when -enable-eh
is set, provided the target supports Dwarf EH.
llvm-gcc generates nounwind in the right places; other FEs
will need to do so also. Given such a FE, -enable-eh should
no longer be needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86RegisterInfo.cpp')
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 5cd2fbe35e..95026f281a 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -504,6 +504,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>(); MachineBasicBlock::iterator MBBI = MBB.begin(); + bool needsFrameInfo = (MMI && MMI->hasDebugInfo()) || + ExceptionHandling || !Fn->doesNotThrow(); // Prepare for frame info. unsigned FrameLabelId = 0; @@ -536,7 +538,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { .addReg(FramePtr); NumBytes -= SlotSize; - if (MMI && MMI->needsFrameInfo()) { + if (needsFrameInfo) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId).addImm(0); @@ -548,7 +550,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { } unsigned ReadyLabelId = 0; - if (MMI && MMI->needsFrameInfo()) { + if (needsFrameInfo) { // Mark effective beginning of when frame pointer is ready. ReadyLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId).addImm(0); @@ -607,7 +609,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { } } - if (MMI && MMI->needsFrameInfo()) { + if (needsFrameInfo) { std::vector<MachineMove> &Moves = MMI->getFrameMoves(); const TargetData *TD = MF.getTarget().getTargetData(); |