LLVM API Documentation
#include <DwarfException.h>


Classes | |
| struct | ActionEntry |
| ActionEntry - Structure describing an entry in the actions table. More... | |
| struct | CallSiteEntry |
| CallSiteEntry - Structure describing an entry in the call-site table. More... | |
| struct | PadRange |
| PadRange - Structure holding a try-range and the associated landing pad. More... | |
Public Member Functions | |
| DwarfException (AsmPrinter *A) | |
| virtual | ~DwarfException () |
| virtual void | EndModule () |
| virtual void | BeginFunction (const MachineFunction *MF) |
| virtual void | EndFunction () |
| EndFunction - Gather and emit post-function exception information. | |
Protected Types | |
| typedef DenseMap< MCSymbol *, PadRange > | RangeMapType |
Protected Member Functions | |
| unsigned | ComputeActionsTable (const SmallVectorImpl< const LandingPadInfo * > &LPs, SmallVectorImpl< ActionEntry > &Actions, SmallVectorImpl< unsigned > &FirstActions) |
| bool | CallToNoUnwindFunction (const MachineInstr *MI) |
| void | ComputeCallSiteTable (SmallVectorImpl< CallSiteEntry > &CallSites, const RangeMapType &PadMap, const SmallVectorImpl< const LandingPadInfo * > &LPs, const SmallVectorImpl< unsigned > &FirstActions) |
| void | EmitExceptionTable () |
| virtual void | EmitTypeInfos (unsigned TTypeEncoding) |
Static Protected Member Functions | |
| static unsigned | SharedTypeIds (const LandingPadInfo *L, const LandingPadInfo *R) |
| SharedTypeIds - How many leading type ids two landing pads have in common. | |
| static bool | PadLT (const LandingPadInfo *L, const LandingPadInfo *R) |
| PadLT - Order landing pads lexicographically by type id. | |
Protected Attributes | |
| AsmPrinter * | Asm |
| Asm - Target of Dwarf emission. | |
| MachineModuleInfo * | MMI |
| MMI - Collected machine module information. | |
DwarfException - Emits Dwarf exception handling directives.
Definition at line 37 of file DwarfException.h.
typedef DenseMap<MCSymbol *, PadRange> llvm::DwarfException::RangeMapType [protected] |
Definition at line 60 of file DwarfException.h.
| DwarfException::DwarfException | ( | AsmPrinter * | A | ) |
Definition at line 40 of file DwarfException.cpp.
| DwarfException::~DwarfException | ( | ) | [virtual] |
Definition at line 43 of file DwarfException.cpp.
| void DwarfException::BeginFunction | ( | const MachineFunction * | MF | ) | [virtual] |
BeginFunction - Gather pre-function exception information. Assumes being emitted immediately after the function entry point.
BeginFunction - Gather pre-function exception information. Assumes it's being emitted immediately after the function entry point.
Reimplemented in llvm::Win64Exception, llvm::ARMException, and llvm::DwarfCFIException.
Definition at line 728 of file DwarfException.cpp.
References llvm_unreachable.
Referenced by llvm::AsmPrinter::EmitFunctionHeader().
| bool DwarfException::CallToNoUnwindFunction | ( | const MachineInstr * | MI | ) | [protected] |
CallToNoUnwindFunction - Return `true' if this is a call to a function marked `nounwind'. Return `false' otherwise.
Definition at line 186 of file DwarfException.cpp.
References llvm::Function::doesNotThrow(), llvm::dyn_cast(), F(), llvm::MachineOperand::getGlobal(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::ARM_PROC::I, llvm::MachineInstr::isCall(), and llvm::MachineOperand::isGlobal().
Referenced by ComputeCallSiteTable().
| unsigned DwarfException::ComputeActionsTable | ( | const SmallVectorImpl< const LandingPadInfo * > & | LandingPads, |
| SmallVectorImpl< ActionEntry > & | Actions, | ||
| SmallVectorImpl< unsigned > & | FirstActions | ||
| ) | [protected] |
ComputeActionsTable - Compute the actions table and gather the first action index for each landing pad site.
Definition at line 76 of file DwarfException.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::MachineModuleInfo::getFilterIds(), llvm::MCAsmInfo::getSLEB128Size(), llvm::MCAsmInfo::getULEB128Size(), llvm::ARM_PROC::I, MMI, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), SharedTypeIds(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::LandingPadInfo::TypeIds.
Referenced by EmitExceptionTable().
| void DwarfException::ComputeCallSiteTable | ( | SmallVectorImpl< CallSiteEntry > & | CallSites, |
| const RangeMapType & | PadMap, | ||
| const SmallVectorImpl< const LandingPadInfo * > & | LandingPads, | ||
| const SmallVectorImpl< unsigned > & | FirstActions | ||
| ) | [protected] |
ComputeCallSiteTable - Compute the call-site table. The entry for an invoke has a try-range containing the call, a non-zero landing pad and an appropriate action. The entry for an ordinary call has a try-range containing the call and zero for the landing pad and the action. Calls marked 'nounwind' have no entry and must not be contained in the try-range of any entry - they form gaps in the table. Entries must be ordered by try-range address.
ComputeCallSiteTable - Compute the call-site table. The entry for an invoke has a try-range containing the call, a non-zero landing pad, and an appropriate action. The entry for an ordinary call has a try-range containing the call and zero for the landing pad and the action. Calls marked 'nounwind' have no entry and must not be contained in the try-range of any entry - they form gaps in the table. Entries must be ordered by try-range address.
Definition at line 226 of file DwarfException.cpp.
References llvm::DwarfException::CallSiteEntry::Action, Asm, llvm::SmallVectorTemplateCommon< T >::back(), llvm::MachineFunction::begin(), llvm::LandingPadInfo::BeginLabels, CallToNoUnwindFunction(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::MachineFunction::end(), llvm::DwarfException::CallSiteEntry::EndLabel, llvm::LandingPadInfo::EndLabels, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::MachineModuleInfo::getCallSiteBeginLabel(), llvm::ARM_PROC::I, llvm::MCAsmInfo::isExceptionHandlingDwarf(), llvm::LandingPadInfo::LandingPadLabel, llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, llvm::A64CC::MI, MMI, P, llvm::DwarfException::PadRange::PadIndex, llvm::DwarfException::CallSiteEntry::PadLabel, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::DwarfException::PadRange::RangeIndex, llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorTemplateCommon< T >::size().
Referenced by EmitExceptionTable().
| void DwarfException::EmitExceptionTable | ( | ) | [protected] |
EmitExceptionTable - Emit landing pads and actions.
The general organization of the table is complex, but the basic concepts are easy. First there is a header which describes the location and organization of the three components that follow. 1. The landing pad site information describes the range of code covered by the try. In our case it's an accumulation of the ranges covered by the invokes in the try. There is also a reference to the landing pad that handles the exception once processed. Finally an index into the actions table. 2. The action table, in our case, is composed of pairs of type ids and next action offset. Starting with the action index from the landing pad site, each type Id is checked for a match to the current exception. If it matches then the exception and type id are passed on to the landing pad. Otherwise the next action is looked up. This chain is terminated with a next action of zero. If no type id is found the frame is unwound and handling continues. 3. Type id table contains references to all the C++ typeinfo for all catches in the function. This tables is reversed indexed base 1.
EmitExceptionTable - Emit landing pads and actions.
The general organization of the table is complex, but the basic concepts are easy. First there is a header which describes the location and organization of the three components that follow.
1. The landing pad site information describes the range of code covered by the try. In our case it's an accumulation of the ranges covered by the invokes in the try. There is also a reference to the landing pad that handles the exception once processed. Finally an index into the actions table. 2. The action table, in our case, is composed of pairs of type IDs and next action offset. Starting with the action index from the landing pad site, each type ID is checked for a match to the current exception. If it matches then the exception and type id are passed on to the landing pad. Otherwise the next action is looked up. This chain is terminated with a next action of zero. If no type id is found then the frame is unwound and handling continues. 3. Type ID table contains references to all the C++ typeinfo for all catches in the function. This tables is reverse indexed base 1.
Definition at line 347 of file DwarfException.cpp.
References llvm::DwarfException::CallSiteEntry::Action, llvm::MCStreamer::AddComment(), Asm, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::DwarfException::CallSiteEntry::BeginLabel, llvm::LandingPadInfo::BeginLabels, ComputeActionsTable(), ComputeCallSiteTable(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::dwarf::DW_EH_PE_omit, llvm::dwarf::DW_EH_PE_udata4, llvm::AsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitEncodingByte(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitLabel(), llvm::AsmPrinter::EmitLabelDifference(), llvm::AsmPrinter::EmitSLEB128(), EmitTypeInfos(), llvm::AsmPrinter::EmitULEB128(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::DwarfException::CallSiteEntry::EndLabel, llvm::AsmPrinter::getDataLayout(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::MachineModuleInfo::getFilterIds(), llvm::AsmPrinter::getFunctionNumber(), llvm::MachineModuleInfo::getLandingPads(), llvm::MCObjectFileInfo::getLSDASection(), llvm::MCSymbol::getName(), llvm::AsmPrinter::getObjFileLowering(), llvm::MCContext::GetOrCreateSymbol(), llvm::DataLayout::getPointerSize(), llvm::AsmPrinter::GetSizeOfEncodedValue(), llvm::AsmPrinter::GetTempSymbol(), llvm::MCObjectFileInfo::getTTypeEncoding(), llvm::MachineModuleInfo::getTypeInfos(), llvm::MCAsmInfo::getULEB128Size(), llvm::ARM_PROC::I, llvm::MCAsmInfo::isExceptionHandlingDwarf(), llvm::MCStreamer::isVerboseAsm(), llvm::AsmPrinter::MAI, MMI, N, llvm::DwarfException::ActionEntry::NextAction, llvm::AsmPrinter::OutContext, llvm::AsmPrinter::OutStreamer, P, llvm::DwarfException::CallSiteEntry::PadLabel, PadLT(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::ExceptionHandling::SjLj, llvm::MCStreamer::SwitchSection(), and llvm::DwarfException::ActionEntry::ValueForTypeID.
Referenced by llvm::DwarfCFIException::EndFunction(), llvm::ARMException::EndFunction(), and llvm::Win64Exception::EndFunction().
| void DwarfException::EmitTypeInfos | ( | unsigned | TTypeEncoding | ) | [protected, virtual] |
Definition at line 679 of file DwarfException.cpp.
References llvm::MCStreamer::AddBlankLine(), llvm::MCStreamer::AddComment(), Asm, llvm::AsmPrinter::EmitTTypeReference(), llvm::AsmPrinter::EmitULEB128(), llvm::MachineModuleInfo::getFilterIds(), llvm::MachineModuleInfo::getTypeInfos(), llvm::ARM_PROC::I, llvm::MCStreamer::isVerboseAsm(), MMI, and llvm::AsmPrinter::OutStreamer.
Referenced by EmitExceptionTable().
| void DwarfException::EndFunction | ( | ) | [virtual] |
EndFunction - Gather and emit post-function exception information.
Reimplemented in llvm::Win64Exception, llvm::ARMException, and llvm::DwarfCFIException.
Definition at line 734 of file DwarfException.cpp.
References llvm_unreachable.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
| void DwarfException::EndModule | ( | ) | [virtual] |
EndModule - Emit all exception information that should come after the content.
Reimplemented in llvm::Win64Exception, llvm::ARMException, and llvm::DwarfCFIException.
Definition at line 722 of file DwarfException.cpp.
References llvm_unreachable.
Referenced by llvm::AsmPrinter::doFinalization().
| bool DwarfException::PadLT | ( | const LandingPadInfo * | L, |
| const LandingPadInfo * | R | ||
| ) | [static, protected] |
PadLT - Order landing pads lexicographically by type id.
Definition at line 61 of file DwarfException.cpp.
References llvm::LandingPadInfo::TypeIds.
Referenced by EmitExceptionTable().
| unsigned DwarfException::SharedTypeIds | ( | const LandingPadInfo * | L, |
| const LandingPadInfo * | R | ||
| ) | [static, protected] |
SharedTypeIds - How many leading type ids two landing pads have in common.
Definition at line 46 of file DwarfException.cpp.
References llvm::LandingPadInfo::TypeIds.
Referenced by ComputeActionsTable().
AsmPrinter* llvm::DwarfException::Asm [protected] |
Asm - Target of Dwarf emission.
Definition at line 40 of file DwarfException.h.
Referenced by llvm::DwarfCFIException::BeginFunction(), llvm::ARMException::BeginFunction(), llvm::Win64Exception::BeginFunction(), ComputeCallSiteTable(), EmitExceptionTable(), EmitTypeInfos(), llvm::DwarfCFIException::EndFunction(), llvm::ARMException::EndFunction(), llvm::Win64Exception::EndFunction(), and llvm::DwarfCFIException::EndModule().
MachineModuleInfo* llvm::DwarfException::MMI [protected] |
MMI - Collected machine module information.
Definition at line 43 of file DwarfException.h.
Referenced by llvm::DwarfCFIException::BeginFunction(), llvm::Win64Exception::BeginFunction(), ComputeActionsTable(), ComputeCallSiteTable(), EmitExceptionTable(), EmitTypeInfos(), llvm::DwarfCFIException::EndFunction(), llvm::ARMException::EndFunction(), llvm::Win64Exception::EndFunction(), and llvm::DwarfCFIException::EndModule().