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 | 7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636 (patch) | |
tree | 55529d204c6f6539a6f42d40457693279a0f8dff /llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | |
parent | a9590d1c0d0f99702a16cf387cf53f28803c962f (diff) | |
download | bcm5719-llvm-7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636.tar.gz bcm5719-llvm-7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636.zip |
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.
llvm-svn: 49006
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp index 0e6bc69023d..cc3b583cc27 100644 --- a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -20,6 +20,7 @@ #include "PPCFrameInfo.h" #include "PPCSubtarget.h" #include "llvm/Constants.h" +#include "llvm/Function.h" #include "llvm/Type.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/MachineInstrBuilder.h" @@ -946,6 +947,8 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { MachineBasicBlock::iterator MBBI = MBB.begin(); MachineFrameInfo *MFI = MF.getFrameInfo(); MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + bool needsFrameInfo = (MMI && MMI->hasDebugInfo()) || + ExceptionHandling || !MF.getFunction()->doesNotThrow(); // Prepare for frame info. unsigned FrameLabelId = 0; @@ -1019,7 +1022,7 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); unsigned MaxAlign = MFI->getMaxAlignment(); - if (MMI && MMI->needsFrameInfo()) { + if (needsFrameInfo) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId).addImm(0); @@ -1095,7 +1098,7 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { } } - if (MMI && MMI->needsFrameInfo()) { + if (needsFrameInfo) { std::vector<MachineMove> &Moves = MMI->getFrameMoves(); if (NegFrameSize) { |