|
LLVM
4.0.0
|
Base class for debug information backends. More...
#include <DebugHandlerBase.h>
Public Member Functions | |
| void | beginInstruction (const MachineInstr *MI) override |
| Process beginning of an instruction. More... | |
| void | endInstruction () override |
| Process end of an instruction. More... | |
| void | beginFunction (const MachineFunction *MF) override |
| Gather pre-function debug information. More... | |
| void | endFunction (const MachineFunction *MF) override |
| Gather post-function debug information. More... | |
| MCSymbol * | getLabelBeforeInsn (const MachineInstr *MI) |
| Return Label preceding the instruction. More... | |
| MCSymbol * | getLabelAfterInsn (const MachineInstr *MI) |
| Return Label immediately following the instruction. More... | |
Public Member Functions inherited from llvm::AsmPrinterHandler | |
| virtual | ~AsmPrinterHandler () |
| Pin vtable to this file. More... | |
| virtual void | setSymbolSize (const MCSymbol *Sym, uint64_t Size)=0 |
| For symbols that have a size designated (e.g. More... | |
| virtual void | endModule ()=0 |
| Emit all sections that should come after the content. More... | |
| virtual void | markFunctionEnd () |
| 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 int | fragmentCmp (const DIExpression *P1, const DIExpression *P2) |
| Determine the relative position of the fragments described by P1 and P2. More... | |
| static bool | fragmentsOverlap (const DIExpression *P1, const DIExpression *P2) |
| Determine whether two variable fragments overlap. More... | |
| static uint64_t | getBaseTypeSize (const DITypeRef TyRef) |
| If this type is derived from a base type then return base type size. More... | |
Protected Member Functions | |
| DebugHandlerBase (AsmPrinter *A) | |
| void | identifyScopeMarkers () |
| Indentify instructions that are marking the beginning of or ending of a scope. More... | |
| void | requestLabelBeforeInsn (const MachineInstr *MI) |
| Ensure that a label will be emitted before MI. More... | |
| void | requestLabelAfterInsn (const MachineInstr *MI) |
| Ensure that a label will be emitted after MI. More... | |
Protected Attributes | |
| AsmPrinter * | Asm |
| Target of debug info emission. More... | |
| MachineModuleInfo * | MMI |
| Collected machine module information. More... | |
| DebugLoc | PrevInstLoc |
| Previous instruction's location information. More... | |
| MCSymbol * | PrevLabel = nullptr |
| const MachineBasicBlock * | PrevInstBB = nullptr |
| DebugLoc | PrologEndLoc |
| This location indicates end of function prologue and beginning of function body. More... | |
| const MachineInstr * | CurMI = nullptr |
| If nonnull, stores the current machine instruction we're processing. More... | |
| LexicalScopes | LScopes |
| DbgValueHistoryMap | DbgValues |
| History of DBG_VALUE and clobber instructions for each user variable. More... | |
| DenseMap< const MachineInstr *, MCSymbol * > | LabelsBeforeInsn |
| Maps instruction with label emitted before instruction. More... | |
| DenseMap< const MachineInstr *, MCSymbol * > | LabelsAfterInsn |
| Maps instruction with label emitted after instruction. More... | |
Base class for debug information backends.
Common functionality related to tracking which variables and scopes are alive at a given PC live here.
Definition at line 30 of file DebugHandlerBase.h.
|
protected |
Definition at line 26 of file DebugHandlerBase.cpp.
|
overridevirtual |
Gather pre-function debug information.
Every beginFunction(MF) call should be followed by an endFunction(MF) call.
Implements llvm::AsmPrinterHandler.
Reimplemented in llvm::DwarfDebug.
Definition at line 118 of file DebugHandlerBase.cpp.
References llvm::all_of(), Asm, assert(), llvm::calculateDbgValueHistory(), DbgValues, llvm::DbgValueHistoryMap::empty(), llvm::LexicalScopes::empty(), fragmentsOverlap(), llvm::getDISubprogram(), llvm::MachineFunction::getFunction(), llvm::AsmPrinter::getFunctionBegin(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::DILocalVariable::getScope(), llvm::MachineFunction::getSubtarget(), I, identifyScopeMarkers(), llvm::LexicalScopes::initialize(), llvm::DILocalVariable::isParameter(), LabelsBeforeInsn, LScopes, llvm::AsmPrinter::MF, PrevInstLoc, PrevLabel, requestLabelAfterInsn(), and requestLabelBeforeInsn().
Referenced by llvm::CodeViewDebug::beginFunction(), and llvm::DwarfDebug::beginFunction().
|
overridevirtual |
Process beginning of an instruction.
Implements llvm::AsmPrinterHandler.
Reimplemented in llvm::DwarfDebug.
Definition at line 172 of file DebugHandlerBase.cpp.
References Asm, assert(), llvm::MCContext::createTempSymbol(), CurMI, llvm::MachineModuleInfo::getContext(), llvm::MachineModuleInfo::hasDebugInfo(), I, LabelsBeforeInsn, MI, MMI, llvm::AsmPrinter::OutStreamer, and PrevLabel.
Referenced by llvm::CodeViewDebug::beginInstruction(), and llvm::DwarfDebug::beginInstruction().
|
overridevirtual |
Gather post-function debug information.
Please note that some AsmPrinter implementations may not call beginFunction at all.
Implements llvm::AsmPrinterHandler.
Reimplemented in llvm::DwarfDebug.
Definition at line 230 of file DebugHandlerBase.cpp.
References llvm::DbgValueHistoryMap::clear(), DbgValues, LabelsAfterInsn, and LabelsBeforeInsn.
Referenced by llvm::CodeViewDebug::endFunction(), and llvm::DwarfDebug::endFunction().
|
overridevirtual |
Process end of an instruction.
Implements llvm::AsmPrinterHandler.
Definition at line 198 of file DebugHandlerBase.cpp.
References Asm, assert(), llvm::MCContext::createTempSymbol(), CurMI, llvm::MachineModuleInfo::getContext(), llvm::MachineInstr::getParent(), llvm::MachineModuleInfo::hasDebugInfo(), I, llvm::MachineInstr::isDebugValue(), LabelsAfterInsn, MMI, llvm::AsmPrinter::OutStreamer, PrevInstBB, and PrevLabel.
|
static |
Determine the relative position of the fragments described by P1 and P2.
Returns -1 if P1 is entirely before P2, 0 if P1 and P2 overlap, 1 if P1 is entirely after P2.
Definition at line 66 of file DebugHandlerBase.cpp.
References llvm::DIExpression::getFragmentInfo(), r1(), and r2().
Referenced by fragmentsOverlap(), and llvm::DebugLocEntry::MergeValues().
|
static |
Determine whether two variable fragments overlap.
Definition at line 82 of file DebugHandlerBase.cpp.
References fragmentCmp(), and llvm::DIExpression::isFragment().
Referenced by beginFunction().
If this type is derived from a base type then return base type size.
Definition at line 90 of file DebugHandlerBase.cpp.
References assert(), llvm::dyn_cast(), llvm::DIType::getSizeInBits(), llvm::DINode::getTag(), and llvm::TypedDINodeRef< T >::resolve().
| MCSymbol * DebugHandlerBase::getLabelAfterInsn | ( | const MachineInstr * | MI | ) |
Return Label immediately following the instruction.
Definition at line 62 of file DebugHandlerBase.cpp.
References LabelsAfterInsn.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), and llvm::DwarfDebug::isLexicalScopeDIENull().
| MCSymbol * DebugHandlerBase::getLabelBeforeInsn | ( | const MachineInstr * | MI | ) |
Return Label preceding the instruction.
Definition at line 55 of file DebugHandlerBase.cpp.
References assert(), and LabelsBeforeInsn.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC().
|
protected |
Indentify instructions that are marking the beginning of or ending of a scope.
Definition at line 32 of file DebugHandlerBase.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::LexicalScope::getChildren(), llvm::LexicalScopes::getCurrentFunctionScope(), llvm::LexicalScope::getRanges(), llvm::LexicalScope::isAbstractScope(), LScopes, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), requestLabelAfterInsn(), and requestLabelBeforeInsn().
Referenced by beginFunction().
|
inlineprotected |
Ensure that a label will be emitted after MI.
Definition at line 79 of file DebugHandlerBase.h.
References LabelsAfterInsn.
Referenced by beginFunction(), and identifyScopeMarkers().
|
inlineprotected |
Ensure that a label will be emitted before MI.
Definition at line 74 of file DebugHandlerBase.h.
References LabelsBeforeInsn.
Referenced by beginFunction(), and identifyScopeMarkers().
|
protected |
Target of debug info emission.
Definition at line 35 of file DebugHandlerBase.h.
Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), beginFunction(), llvm::CodeViewDebug::beginFunction(), beginInstruction(), llvm::CodeViewDebug::beginInstruction(), llvm::CodeViewDebug::CodeViewDebug(), llvm::DwarfDebug::DwarfDebug(), llvm::CodeViewDebug::endFunction(), endInstruction(), and llvm::CodeViewDebug::endModule().
|
protected |
If nonnull, stores the current machine instruction we're processing.
Definition at line 53 of file DebugHandlerBase.h.
Referenced by beginInstruction(), llvm::DwarfDebug::beginInstruction(), endInstruction(), and llvm::DwarfDebug::endModule().
|
protected |
History of DBG_VALUE and clobber instructions for each user variable.
Variables are listed in order of appearance.
Definition at line 59 of file DebugHandlerBase.h.
Referenced by beginFunction(), and endFunction().
|
protected |
Maps instruction with label emitted after instruction.
Definition at line 67 of file DebugHandlerBase.h.
Referenced by endFunction(), endInstruction(), getLabelAfterInsn(), and requestLabelAfterInsn().
|
protected |
Maps instruction with label emitted before instruction.
FIXME: Make this private from DwarfDebug, we have the necessary accessors for it.
Definition at line 64 of file DebugHandlerBase.h.
Referenced by beginFunction(), beginInstruction(), endFunction(), getLabelBeforeInsn(), and requestLabelBeforeInsn().
|
protected |
Definition at line 55 of file DebugHandlerBase.h.
Referenced by beginFunction(), llvm::DwarfDebug::beginFunction(), llvm::DwarfDebug::endFunction(), and identifyScopeMarkers().
|
protected |
Collected machine module information.
Definition at line 38 of file DebugHandlerBase.h.
Referenced by llvm::CodeViewDebug::beginFunction(), llvm::DwarfDebug::beginFunction(), beginInstruction(), llvm::DwarfDebug::beginModule(), llvm::CodeViewDebug::CodeViewDebug(), llvm::DwarfDebug::DwarfDebug(), llvm::DwarfDebug::endFunction(), endInstruction(), llvm::CodeViewDebug::endModule(), and llvm::DwarfDebug::endModule().
|
protected |
Definition at line 46 of file DebugHandlerBase.h.
Referenced by llvm::DwarfDebug::beginInstruction(), and endInstruction().
|
protected |
Previous instruction's location information.
This is used to determine label location to indicate scope boundaries in debug info. We track the previous instruction's source location (if not line 0), whether it was a label, and its parent BB.
Definition at line 44 of file DebugHandlerBase.h.
Referenced by beginFunction(), llvm::CodeViewDebug::beginInstruction(), and llvm::DwarfDebug::beginInstruction().
|
protected |
Definition at line 45 of file DebugHandlerBase.h.
Referenced by beginFunction(), beginInstruction(), llvm::DwarfDebug::beginInstruction(), llvm::DwarfDebug::endFunction(), and endInstruction().
|
protected |
This location indicates end of function prologue and beginning of function body.
Definition at line 50 of file DebugHandlerBase.h.
Referenced by llvm::CodeViewDebug::beginFunction(), llvm::DwarfDebug::beginFunction(), and llvm::DwarfDebug::beginInstruction().
1.8.6