diff options
author | Dale Johannesen <dalej@apple.com> | 2008-04-02 00:25:04 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-04-02 00:25:04 +0000 |
commit | 1532f3ddd77c362dd5f613af06b4de636e3c5b0e (patch) | |
tree | 52fd71de9a6648a1f69dca1dd3d87ced1bc2adf5 /lib/Target/X86 | |
parent | 7c3becd9d729b976d79b18e6165e74390e613bb5 (diff) | |
download | external_llvm-1532f3ddd77c362dd5f613af06b4de636e3c5b0e.zip external_llvm-1532f3ddd77c362dd5f613af06b4de636e3c5b0e.tar.gz external_llvm-1532f3ddd77c362dd5f613af06b4de636e3c5b0e.tar.bz2 |
Recommitting EH patch; this should answer most of the
review feedback.
-enable-eh is still accepted but doesn't do anything.
EH intrinsics use Dwarf EH if the target supports that,
and are handled by LowerInvoke otherwise.
The separation of the EH table and frame move data is,
I think, logically figured out, but either one still
causes full EH info to be generated (not sure how to
split the metadata correctly).
MachineModuleInfo::needsFrameInfo is no longer used and
is removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/X86ATTAsmPrinter.cpp | 5 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index 0679656..151bf11 100644 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -150,8 +150,9 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { F->getLinkage() == Function::WeakLinkage)) O << "Lllvm$workaround$fake$stub$" << CurrentFnName << ":\n"; - if (TAI->doesSupportDebugInformation()) { - // Emit pre-function debug information. + if (TAI->doesSupportDebugInformation() || + TAI->doesSupportExceptionHandling()) { + // Emit pre-function debug and/or EH information. DW.BeginFunction(&MF); } diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 98e7d9c..e1bc65f 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -381,9 +381,9 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { O << "\n"; - if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI && - !Subtarget->is64Bit()) { + if (TAI->doesSupportExceptionHandling() && MMI && !Subtarget->is64Bit()) { // Add the (possibly multiple) personalities to the set of global values. + // Only referenced functions get into the Personalities list. const std::vector<Function *>& Personalities = MMI->getPersonalities(); for (std::vector<Function *>::const_iterator I = Personalities.begin(), diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 5cd2fbe..6c3484e 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -504,6 +504,7 @@ 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()) || !Fn->doesNotThrow(); // Prepare for frame info. unsigned FrameLabelId = 0; @@ -536,7 +537,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 +549,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 +608,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(); |