|
LLVM
4.0.0
|
Emits exception handling directives. More...
#include <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 | |
| typedef DenseMap< MCSymbol *, PadRange > | RangeMapType |
Protected Member Functions | |
| unsigned | computeActionsTable (const SmallVectorImpl< const LandingPadInfo * > &LPs, 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 * > &LPs, const SmallVectorImpl< unsigned > &FirstActions) |
| Compute the call-site table. More... | |
| void | emitExceptionTable () |
| Emit landing pads and actions. More... | |
| virtual void | emitTypeInfos (unsigned TTypeEncoding) |
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 32 of file EHStreamer.h.
|
protected |
Definition at line 52 of file EHStreamer.h.
| EHStreamer::EHStreamer | ( | AsmPrinter * | A | ) |
Definition at line 28 of file EHStreamer.cpp.
|
override |
Definition at line 30 of file EHStreamer.cpp.
|
inlineoverridevirtual |
Process beginning of an instruction.
Implements llvm::AsmPrinterHandler.
Definition at line 127 of file EHStreamer.h.
|
static |
Return `true' if this is a call to a function marked `nounwind'.
Return `false' otherwise.
Definition at line 159 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 50 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, Offset, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::reserve(), sharedTypeIDs(), llvm::SmallVectorTemplateCommon< T >::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 215 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(), L, llvm::LandingPadInfo::LandingPadLabel, llvm::EHStreamer::CallSiteEntry::LPad, llvm::AsmPrinter::MAI, MBB, 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::SmallVectorTemplateCommon< T >::size(), llvm::SjLj, and llvm::MCAsmInfo::usesCFIForEH().
Referenced by emitExceptionTable().
|
protected |
Definition at line 191 of file EHStreamer.cpp.
References assert(), llvm::LandingPadInfo::BeginLabels, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), E, i, N, P, and llvm::SmallVectorTemplateCommon< T >::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 338 of file EHStreamer.cpp.
References llvm::EHStreamer::CallSiteEntry::Action, Asm, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::EHStreamer::CallSiteEntry::BeginLabel, computeActionsTable(), computeCallSiteTable(), llvm::dwarf::DW_EH_PE_omit, llvm::dwarf::DW_EH_PE_udata4, E, llvm::AsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitEncodingByte(), llvm::AsmPrinter::EmitLabelDifference(), llvm::AsmPrinter::EmitSLEB128(), emitTypeInfos(), llvm::AsmPrinter::EmitULEB128(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::EHStreamer::CallSiteEntry::EndLabel, llvm::AsmPrinter::getCurExceptionSym(), llvm::AsmPrinter::getDataLayout(), 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::DataLayout::getPointerSize(), llvm::AsmPrinter::GetSizeOfEncodedValue(), llvm::MCObjectFileInfo::getTTypeEncoding(), llvm::MachineFunction::getTypeInfos(), llvm::getULEB128Size(), I, i, L, 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::SmallVectorTemplateCommon< T >::size(), llvm::SjLj, llvm::LandingPadInfo::TypeIds, and llvm::EHStreamer::ActionEntry::ValueForTypeID.
Referenced by llvm::DwarfCFIException::endFunction(), llvm::ARMException::endFunction(), and llvm::WinException::endFunction().
|
protectedvirtual |
Definition at line 652 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 128 of file EHStreamer.h.
|
inlinestaticprotected |
Definition at line 119 of file EHStreamer.h.
|
inlinestaticprotected |
Definition at line 118 of file EHStreamer.h.
|
inlinestaticprotected |
Definition at line 117 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 126 of file EHStreamer.h.
|
staticprotected |
How many leading type ids two landing pads have in common.
Definition at line 33 of file EHStreamer.cpp.
References llvm::LandingPadInfo::TypeIds.
Referenced by computeActionsTable().
|
protected |
Target of directive emission.
Definition at line 35 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(), and llvm::DwarfCFIExceptionBase::markFunctionEnd().
|
protected |
Collected machine module information.
Definition at line 38 of file EHStreamer.h.
Referenced by llvm::DwarfCFIException::beginFragment(), llvm::WinException::beginFunclet(), llvm::DwarfCFIException::endModule(), and llvm::WinException::endModule().
1.8.6