Produce a __debug_frame section on darwin ARM when appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2011-05-10 21:04:45 +00:00
parent e3a0e987f3
commit 6253c7ca60
5 changed files with 8 additions and 75 deletions

View File

@ -193,8 +193,6 @@ bool AsmPrinter::doInitialization(Module &M) {
case ExceptionHandling::None: case ExceptionHandling::None:
return false; return false;
case ExceptionHandling::SjLj: case ExceptionHandling::SjLj:
DE = new DwarfSjLjException(this);
return false;
case ExceptionHandling::DwarfCFI: case ExceptionHandling::DwarfCFI:
DE = new DwarfCFIException(this); DE = new DwarfCFIException(this);
return false; return false;
@ -593,11 +591,13 @@ static bool EmitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
} }
AsmPrinter::CFIMoveType AsmPrinter::needsCFIMoves() { AsmPrinter::CFIMoveType AsmPrinter::needsCFIMoves() {
if (UnwindTablesMandatory) if (MAI->getExceptionHandlingType() == ExceptionHandling::DwarfCFI) {
return CFI_M_EH; if (UnwindTablesMandatory)
return CFI_M_EH;
if (!MF->getFunction()->doesNotThrow()) if (!MF->getFunction()->doesNotThrow())
return CFI_M_EH; return CFI_M_EH;
}
if (MMI->hasDebugInfo()) if (MMI->hasDebugInfo())
return CFI_M_Debug; return CFI_M_Debug;

View File

@ -8,7 +8,6 @@ add_llvm_library(LLVMAsmPrinter
DwarfCompileUnit.cpp DwarfCompileUnit.cpp
DwarfDebug.cpp DwarfDebug.cpp
DwarfException.cpp DwarfException.cpp
DwarfSjLjException.cpp
OcamlGCPrinter.cpp OcamlGCPrinter.cpp
) )

View File

@ -174,26 +174,6 @@ public:
virtual void EndFunction(); virtual void EndFunction();
}; };
class DwarfSjLjException : public DwarfException {
public:
//===--------------------------------------------------------------------===//
// Main entry points.
//
DwarfSjLjException(AsmPrinter *A);
virtual ~DwarfSjLjException();
/// EndModule - Emit all exception information that should come after the
/// content.
virtual void EndModule();
/// BeginFunction - Gather pre-function exception information. Assumes being
/// emitted immediately after the function entry point.
virtual void BeginFunction(const MachineFunction *MF);
/// EndFunction - Gather and emit post-function exception information.
virtual void EndFunction();
};
class ARMException : public DwarfException { class ARMException : public DwarfException {
/// shouldEmitTable - Per-function flag to indicate if EH tables should /// shouldEmitTable - Per-function flag to indicate if EH tables should
/// be emitted. /// be emitted.

View File

@ -1,46 +0,0 @@
//===-- CodeGen/AsmPrinter/DwarfSjLjException.cpp - Dwarf Exception Impl --==//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a simple implementation of DwarfException that just produces
// the exception table for use with SjLj.
//
//===----------------------------------------------------------------------===//
#include "DwarfException.h"
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
using namespace llvm;
DwarfSjLjException::DwarfSjLjException(AsmPrinter *A) : DwarfException(A) {
}
DwarfSjLjException::~DwarfSjLjException() {}
/// EndModule - Emit all exception information that should come after the
/// content.
void DwarfSjLjException::EndModule() {
}
/// BeginFunction - Gather pre-function exception information. Assumes it's
/// being emitted immediately after the function entry point.
void DwarfSjLjException::BeginFunction(const MachineFunction *MF) {
}
/// EndFunction - Gather and emit post-function exception information.
///
void DwarfSjLjException::EndFunction() {
// Record if this personality index uses a landing pad.
bool HasLandingPad = !MMI->getLandingPads().empty();
// Map all labels and get rid of any dead landing pads.
MMI->TidyLandingPads();
if (HasLandingPad)
EmitExceptionTable();
}

View File

@ -4,8 +4,8 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-
target triple = "thumbv7-apple-macosx10.6.7" target triple = "thumbv7-apple-macosx10.6.7"
;CHECK: Ldebug_loc0: ;CHECK: Ldebug_loc0:
;CHECK-NEXT: .long Ltmp0 ;CHECK-NEXT: .long Ltmp1
;CHECK-NEXT: .long Ltmp2 ;CHECK-NEXT: .long Ltmp3
;CHECK-NEXT: .short 6 @ Loc expr size ;CHECK-NEXT: .short 6 @ Loc expr size
;CHECK-NEXT: .byte 144 @ DW_OP_regx for S register ;CHECK-NEXT: .byte 144 @ DW_OP_regx for S register