class EHStreamer

Declaration

class EHStreamer : public AsmPrinterHandler { /* full declaration omitted */ };

Description

Emits exception handling directives.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:30

Inherits from: AsmPrinterHandler

Member Variables

protected llvm::AsmPrinter* Asm
Target of directive emission.
protected llvm::MachineModuleInfo* MMI
Collected machine module information.

Method Overview

  • public EHStreamer(llvm::AsmPrinter * A)
  • public void beginInstruction(const llvm::MachineInstr * MI)
  • public static bool callToNoUnwindFunction(const llvm::MachineInstr * MI)
  • protected void computeActionsTable(const SmallVectorImpl<const llvm::LandingPadInfo *> & LandingPads, SmallVectorImpl<llvm::EHStreamer::ActionEntry> & Actions, SmallVectorImpl<unsigned int> & FirstActions)
  • protected virtual void computeCallSiteTable(SmallVectorImpl<llvm::EHStreamer::CallSiteEntry> & CallSites, SmallVectorImpl<llvm::EHStreamer::CallSiteRange> & CallSiteRanges, const SmallVectorImpl<const llvm::LandingPadInfo *> & LandingPads, const SmallVectorImpl<unsigned int> & FirstActions)
  • protected void computePadMap(const SmallVectorImpl<const llvm::LandingPadInfo *> & LandingPads, llvm::EHStreamer::RangeMapType & PadMap)
  • protected llvm::MCSymbol * emitExceptionTable()
  • protected virtual void emitTypeInfos(unsigned int TTypeEncoding, llvm::MCSymbol * TTBaseLabel)
  • public void endInstruction()
  • protected static bool isCatchEHSelector(int Selector)
  • protected static bool isCleanupEHSelector(int Selector)
  • protected static bool isFilterEHSelector(int Selector)
  • public void setSymbolSize(const llvm::MCSymbol * Sym, uint64_t Size)
  • protected static unsigned int sharedTypeIDs(const llvm::LandingPadInfo * L, const llvm::LandingPadInfo * R)
  • public ~EHStreamer()

Inherited from AsmPrinterHandler:

Methods

EHStreamer(llvm::AsmPrinter* A)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:150

Parameters

llvm::AsmPrinter* A

void beginInstruction(
    const llvm::MachineInstr* MI)

Description

Process beginning of an instruction.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:155

Parameters

const llvm::MachineInstr* MI

static bool callToNoUnwindFunction(
    const llvm::MachineInstr* MI)

Description

Return `true' if this is a call to a function marked `nounwind'. Return `false' otherwise.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:160

Parameters

const llvm::MachineInstr* MI

void computeActionsTable(
    const SmallVectorImpl<
        const llvm::LandingPadInfo*>& LandingPads,
    SmallVectorImpl<
        llvm::EHStreamer::ActionEntry>& Actions,
    SmallVectorImpl<unsigned int>& FirstActions)

Description

Compute the actions table and gather the first action index for each landing pad site.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:95

Parameters

const SmallVectorImpl< const llvm::LandingPadInfo*>& LandingPads
SmallVectorImpl<llvm::EHStreamer::ActionEntry>& Actions
SmallVectorImpl<unsigned int>& FirstActions

virtual void computeCallSiteTable(
    SmallVectorImpl<
        llvm::EHStreamer::CallSiteEntry>&
        CallSites,
    SmallVectorImpl<
        llvm::EHStreamer::CallSiteRange>&
        CallSiteRanges,
    const SmallVectorImpl<
        const llvm::LandingPadInfo*>& LandingPads,
    const SmallVectorImpl<unsigned int>&
        FirstActions)

Description

Compute the call-site table and the call-site ranges. 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. CallSiteRanges vector is only populated for Itanium exception handling.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:111

Parameters

SmallVectorImpl<llvm::EHStreamer::CallSiteEntry>& CallSites
SmallVectorImpl<llvm::EHStreamer::CallSiteRange>& CallSiteRanges
const SmallVectorImpl< const llvm::LandingPadInfo*>& LandingPads
const SmallVectorImpl<unsigned int>& FirstActions

void computePadMap(
    const SmallVectorImpl<
        const llvm::LandingPadInfo*>& LandingPads,
    llvm::EHStreamer::RangeMapType& PadMap)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:100

Parameters

const SmallVectorImpl< const llvm::LandingPadInfo*>& LandingPads
llvm::EHStreamer::RangeMapType& PadMap

llvm::MCSymbol* emitExceptionTable()

Description

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. Returns the starting symbol of an exception table.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:138

virtual void emitTypeInfos(
    unsigned int TTypeEncoding,
    llvm::MCSymbol* TTBaseLabel)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:140

Parameters

unsigned int TTypeEncoding
llvm::MCSymbol* TTBaseLabel

void endInstruction()

Description

Process end of an instruction.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:156

static bool isCatchEHSelector(int Selector)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:147

Parameters

int Selector

static bool isCleanupEHSelector(int Selector)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:146

Parameters

int Selector

static bool isFilterEHSelector(int Selector)

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:145

Parameters

int Selector

void setSymbolSize(const llvm::MCSymbol* Sym,
                   uint64_t Size)

Description

For symbols that have a size designated (e.g. common symbols), this tracks that size.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:154

Parameters

const llvm::MCSymbol* Sym
uint64_t Size

static unsigned int sharedTypeIDs(
    const llvm::LandingPadInfo* L,
    const llvm::LandingPadInfo* R)

Description

How many leading type ids two landing pads have in common.

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:39

Parameters

const llvm::LandingPadInfo* L
const llvm::LandingPadInfo* R

~EHStreamer()

Declared at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.h:151