|
LLVM
3.7.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... | |
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... | |
| bool | callToNoUnwindFunction (const MachineInstr *MI) |
| Return `true' if this is a call to a function marked `nounwind'. 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 33 of file EHStreamer.h.
|
protected |
Definition at line 53 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 132 of file EHStreamer.h.
|
protected |
Return `true' if this is a call to a function marked `nounwind'.
Return `false' otherwise.
Definition at line 159 of file EHStreamer.cpp.
References llvm::Function::doesNotThrow(), llvm::dyn_cast(), 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 llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::MachineModuleInfo::getFilterIds(), llvm::getSLEB128Size(), llvm::getULEB128Size(), I, isFilterEHSelector(), MMI, 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, 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::MachineModuleInfo::getCallSiteBeginLabel(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::LandingPadInfo::LandingPadLabel, llvm::EHStreamer::CallSiteEntry::LPad, llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, llvm::AArch64CC::MI, MMI, 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 llvm::LandingPadInfo::BeginLabels, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), 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, 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::MachineModuleInfo::getFilterIds(), llvm::AsmPrinter::getFunctionBegin(), llvm::AsmPrinter::getFunctionEnd(), 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::MCObjectFileInfo::getTTypeEncoding(), llvm::MachineModuleInfo::getTypeInfos(), llvm::getULEB128Size(), I, llvm::LandingPadInfo::LandingPadLabel, llvm::EHStreamer::CallSiteEntry::LPad, llvm::AsmPrinter::MAI, MMI, 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::WinException::endFunction(), and llvm::ARMException::endFunction().
|
protectedvirtual |
Definition at line 651 of file EHStreamer.cpp.
References Asm, llvm::AsmPrinter::EmitTTypeReference(), llvm::AsmPrinter::EmitULEB128(), llvm::MachineModuleInfo::getFilterIds(), llvm::MachineModuleInfo::getTypeInfos(), I, isFilterEHSelector(), MMI, and llvm::AsmPrinter::OutStreamer.
Referenced by emitExceptionTable().
|
inlineoverridevirtual |
Process end of an instruction.
Implements llvm::AsmPrinterHandler.
Definition at line 133 of file EHStreamer.h.
Definition at line 124 of file EHStreamer.h.
Definition at line 123 of file EHStreamer.h.
Definition at line 122 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 131 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 36 of file EHStreamer.h.
Referenced by llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), llvm::ARMException::beginFunction(), computeCallSiteTable(), emitExceptionTable(), emitTypeInfos(), llvm::WinException::endFunction(), llvm::ARMException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::WinException::endModule(), llvm::ARMException::endModule(), and llvm::DwarfCFIExceptionBase::markFunctionEnd().
|
protected |
Collected machine module information.
Definition at line 39 of file EHStreamer.h.
Referenced by llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), computeActionsTable(), computeCallSiteTable(), emitExceptionTable(), emitTypeInfos(), llvm::WinException::endFunction(), llvm::ARMException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::WinException::endModule(), and llvm::DwarfCFIExceptionBase::markFunctionEnd().
1.8.6