1 //===-- CodeGen/AsmPrinter/DwarfTableException.cpp - Dwarf Exception Impl --==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a simple implementation of DwarfException that just produces
11 // the exception table for use with SjLj.
13 //===----------------------------------------------------------------------===//
15 #include "DwarfException.h"
16 #include "llvm/CodeGen/MachineLocation.h"
17 #include "llvm/CodeGen/MachineModuleInfo.h"
20 DwarfSjLjException::DwarfSjLjException(AsmPrinter *A) : DwarfException(A) {
23 DwarfSjLjException::~DwarfSjLjException() {}
25 /// EndModule - Emit all exception information that should come after the
27 void DwarfSjLjException::EndModule() {
30 /// BeginFunction - Gather pre-function exception information. Assumes it's
31 /// being emitted immediately after the function entry point.
32 void DwarfSjLjException::BeginFunction(const MachineFunction *MF) {
35 /// EndFunction - Gather and emit post-function exception information.
37 void DwarfSjLjException::EndFunction() {
38 // Record if this personality index uses a landing pad.
39 bool HasLandingPad = !MMI->getLandingPads().empty();
41 // Map all labels and get rid of any dead landing pads.
42 MMI->TidyLandingPads();