|
LLVM
7.0.0
|
Emits exception handling directives. More...
#include "CodeGen/AsmPrinter/EHStreamer.h"
Classes | |
| struct | ActionEntry |
| Structure describing an entry in the actions table. More... | |
| struct | CallSiteEntry |
| Structure describing an entry in the call-site table. More... | |
| struct | PadRange |
| Structure holding a try-range and the associated landing pad. More... | |
Public Member Functions | |
| EHStreamer (AsmPrinter *A) | |
| ~EHStreamer () override | |
| void | setSymbolSize (const MCSymbol *Sym, uint64_t Size) override |
| For symbols that have a size designated (e.g. More... | |
| void | beginInstruction (const MachineInstr *MI) override |
| Process beginning of an instruction. More... | |
| void | endInstruction () override |
| Process end of an instruction. More... | |
Public Member Functions inherited from llvm::AsmPrinterHandler | |
| virtual | ~AsmPrinterHandler () |
| Pin vtable to this file. More... | |
| virtual void | endModule ()=0 |
| Emit all sections that should come after the content. More... | |
| virtual void | beginFunction (const MachineFunction *MF)=0 |
| Gather pre-function debug information. More... | |
| virtual void | markFunctionEnd () |
| virtual void | endFunction (const MachineFunction *MF)=0 |
| Gather post-function debug information. More... | |
| virtual void | beginFragment (const MachineBasicBlock *MBB, ExceptionSymbolProvider ESP) |
| virtual void | endFragment () |
| virtual void | beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr) |
| Emit target-specific EH funclet machinery. More... | |
| virtual void | endFunclet () |
Static Public Member Functions | |
| static bool | callToNoUnwindFunction (const MachineInstr *MI) |
| Return `true' if this is a call to a function marked `nounwind'. More... | |
Protected Types | |
| using | RangeMapType = DenseMap< MCSymbol *, PadRange > |
Protected Member Functions | |
| void | computeActionsTable (const SmallVectorImpl< const LandingPadInfo *> &LandingPads, SmallVectorImpl< ActionEntry > &Actions, SmallVectorImpl< unsigned > &FirstActions) |
| Compute the actions table and gather the first action index for each landing pad site. More... | |
| void | computePadMap (const SmallVectorImpl< const LandingPadInfo *> &LandingPads, RangeMapType &PadMap) |
| void | computeCallSiteTable (SmallVectorImpl< CallSiteEntry > &CallSites, const SmallVectorImpl< const LandingPadInfo *> &LandingPads, const SmallVectorImpl< unsigned > &FirstActions) |
| Compute the call-site table. More... | |
| void | emitExceptionTable () |
| Emit landing pads and actions. More... | |
| virtual void | emitTypeInfos (unsigned TTypeEncoding, MCSymbol *TTBaseLabel) |
Static Protected Member Functions | |
| static unsigned | sharedTypeIDs (const LandingPadInfo *L, const LandingPadInfo *R) |
| How many leading type ids two landing pads have in common. More... | |
| static bool | isFilterEHSelector (int Selector) |
| static bool | isCleanupEHSelector (int Selector) |
| static bool | isCatchEHSelector (int Selector) |
Protected Attributes | |
| AsmPrinter * | Asm |
| Target of directive emission. More... | |
| MachineModuleInfo * | MMI |
| Collected machine module information. More... | |
Emits exception handling directives.
Definition at line 31 of file EHStreamer.h.
|
protected |
Definition at line 52 of file EHStreamer.h.
| EHStreamer::EHStreamer | ( | AsmPrinter * | A | ) |
Definition at line 40 of file EHStreamer.cpp.
References ~EHStreamer().
|
overridedefault |
Referenced by EHStreamer().
|
inlineoverridevirtual |
Process beginning of an instruction.
Implements llvm::AsmPrinterHandler.
Definition at line 128 of file EHStreamer.h.
|
static |
Return `true' if this is a call to a function marked `nounwind'.
Return `false' otherwise.
Definition at line 168 of file EHStreamer.cpp.
References assert(), llvm::Function::doesNotThrow(), llvm::dyn_cast(), E, F(), llvm::MachineOperand::getGlobal(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), I, llvm::MachineInstr::isCall(), and llvm::MachineOperand::isGlobal().
Referenced by computeCallSiteTable().
|
protected |
Compute the actions table and gather the first action index for each landing pad site.
Definition at line 61 of file EHStreamer.cpp.
References Asm, assert(), llvm::SmallVectorTemplateCommon< T >::begin(), E, llvm::SmallVectorTemplateCommon< T >::end(), llvm::MachineFunction::getFilterIds(), llvm::getSLEB128Size(), llvm::getULEB128Size(), I, isFilterEHSelector(), llvm::AsmPrinter::MF, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::reserve(), sharedTypeIDs(), llvm::SmallVectorBase::size(), and llvm::LandingPadInfo::TypeIds.
Referenced by emitExceptionTable().
|
protected |
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.
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 224 of file EHStreamer.cpp.
References llvm::EHStreamer::CallSiteEntry::Action, Asm, assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::LandingPadInfo::BeginLabels, callToNoUnwindFunction(), computePadMap(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::EHStreamer::CallSiteEntry::EndLabel, llvm::LandingPadInfo::EndLabels, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineFunction::getCallSiteBeginLabel(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::LandingPadInfo::LandingPadLabel, llvm::EHStreamer::CallSiteEntry::LPad, llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, MI, P, llvm::EHStreamer::PadRange::PadIndex, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::EHStreamer::PadRange::RangeIndex, llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorBase::size(), llvm::SjLj, and llvm::MCAsmInfo::usesCFIForEH().
Referenced by computePadMap(), and emitExceptionTable().
|
protected |
Definition at line 200 of file EHStreamer.cpp.
References assert(), llvm::LandingPadInfo::BeginLabels, computeCallSiteTable(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), E, N, P, and llvm::SmallVectorBase::size().
Referenced by computeCallSiteTable().
|
protected |
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.
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.
Definition at line 347 of file EHStreamer.cpp.
References llvm::EHStreamer::CallSiteEntry::Action, Asm, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::EHStreamer::CallSiteEntry::BeginLabel, computeActionsTable(), computeCallSiteTable(), llvm::AsmPrinter::createTempSymbol(), llvm::dwarf::DW_EH_PE_omit, llvm::dwarf::DW_EH_PE_udata4, llvm::dwarf::DW_EH_PE_uleb128, E, llvm::AsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitEncodingByte(), llvm::AsmPrinter::EmitLabelDifferenceAsULEB128(), llvm::AsmPrinter::EmitSLEB128(), emitTypeInfos(), llvm::AsmPrinter::EmitULEB128(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::EHStreamer::CallSiteEntry::EndLabel, llvm::AsmPrinter::getCurExceptionSym(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::MachineFunction::getFilterIds(), llvm::AsmPrinter::getFunctionBegin(), llvm::AsmPrinter::getFunctionEnd(), llvm::AsmPrinter::getFunctionNumber(), llvm::MachineFunction::getLandingPads(), llvm::MCObjectFileInfo::getLSDASection(), llvm::MCSymbol::getName(), llvm::AsmPrinter::getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), llvm::MCObjectFileInfo::getTTypeEncoding(), llvm::MachineFunction::getTypeInfos(), I, llvm::LandingPadInfo::LandingPadLabel, llvm::EHStreamer::CallSiteEntry::LPad, llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, N, llvm::EHStreamer::ActionEntry::NextAction, llvm::AsmPrinter::OutContext, llvm::AsmPrinter::OutStreamer, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::SjLj, llvm::sort(), llvm::LandingPadInfo::TypeIds, and llvm::EHStreamer::ActionEntry::ValueForTypeID.
Referenced by llvm::DwarfCFIException::endFunction(), llvm::ARMException::endFunction(), and llvm::WinException::endFunction().
Definition at line 608 of file EHStreamer.cpp.
References Asm, E, llvm::AsmPrinter::EmitTTypeReference(), llvm::AsmPrinter::EmitULEB128(), llvm::MachineFunction::getFilterIds(), llvm::MachineFunction::getTypeInfos(), I, isFilterEHSelector(), llvm::make_range(), llvm::AsmPrinter::MF, and llvm::AsmPrinter::OutStreamer.
Referenced by emitExceptionTable().
|
inlineoverridevirtual |
Process end of an instruction.
Implements llvm::AsmPrinterHandler.
Definition at line 129 of file EHStreamer.h.
References MI.
|
inlinestaticprotected |
Definition at line 120 of file EHStreamer.h.
|
inlinestaticprotected |
Definition at line 119 of file EHStreamer.h.
|
inlinestaticprotected |
Definition at line 118 of file EHStreamer.h.
Referenced by computeActionsTable(), and emitTypeInfos().
For symbols that have a size designated (e.g.
common symbols), this tracks that size.
Implements llvm::AsmPrinterHandler.
Definition at line 127 of file EHStreamer.h.
|
staticprotected |
How many leading type ids two landing pads have in common.
Definition at line 45 of file EHStreamer.cpp.
References llvm::LandingPadInfo::TypeIds.
Referenced by computeActionsTable().
|
protected |
Target of directive emission.
Definition at line 34 of file EHStreamer.h.
Referenced by llvm::DwarfCFIException::beginFragment(), llvm::WinException::beginFunclet(), llvm::DwarfCFIException::beginFunction(), llvm::ARMException::beginFunction(), llvm::WinException::beginFunction(), computeActionsTable(), computeCallSiteTable(), emitExceptionTable(), emitTypeInfos(), llvm::DwarfCFIExceptionBase::endFragment(), llvm::WinException::endFunclet(), llvm::ARMException::endFunction(), llvm::WinException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::WinException::endModule(), getTryAncestor(), llvm::DwarfCFIExceptionBase::markFunctionEnd(), and llvm::ARMException::~ARMException().
|
protected |
Collected machine module information.
Definition at line 37 of file EHStreamer.h.
Referenced by llvm::DwarfCFIException::beginFragment(), llvm::WinException::beginFunclet(), llvm::DwarfCFIException::endModule(), and llvm::WinException::endModule().
1.8.13