LLVM 22.0.0git
|
This class provides interface to collect and use lexical scoping information from machine instruction. More...
#include "llvm/CodeGen/LexicalScopes.h"
Public Member Functions | |
LexicalScopes ()=default | |
LLVM_ABI void | initialize (const Module &) |
Scan module to build subprogram-to-function map. | |
LLVM_ABI void | scanFunction (const MachineFunction &) |
Scan machine function and constuct lexical scope nest, resets the instance if necessary. | |
LLVM_ABI void | resetModule () |
Reset the instance so that it's prepared for another module. | |
LLVM_ABI void | resetFunction () |
Reset the instance so that it's prepared for another function. | |
bool | empty () |
Return true if there is any lexical scope information available. | |
LexicalScope * | getCurrentFunctionScope () const |
Return lexical scope for the current function. | |
LLVM_ABI void | getMachineBasicBlocks (const DILocation *DL, SmallPtrSetImpl< const MachineBasicBlock * > &MBBs) |
Populate given set using machine basic blocks which have machine instructions that belong to lexical scope identified by DebugLoc. | |
LLVM_ABI bool | dominates (const DILocation *DL, MachineBasicBlock *MBB) |
Return true if DebugLoc's lexical scope dominates at least one machine instruction's lexical scope in a given machine basic block. | |
LLVM_ABI LexicalScope * | findLexicalScope (const DILocation *DL) |
Find lexical scope, either regular or inlined, for the given DebugLoc. | |
ArrayRef< LexicalScope * > | getAbstractScopesList () const |
Return a reference to list of abstract scopes. | |
LexicalScope * | findAbstractScope (const DILocalScope *N) |
Find an abstract scope or return null. | |
LexicalScope * | findInlinedScope (const DILocalScope *N, const DILocation *IA) |
Find an inlined scope for the given scope/inlined-at. | |
LexicalScope * | findLexicalScope (const DILocalScope *N) |
Find regular lexical scope or return null. | |
LLVM_ABI LexicalScope * | getOrCreateAbstractScope (const DILocalScope *Scope) |
Find or create an abstract lexical scope. | |
const Function * | getFunction (const DISubprogram *SP) const |
Get function to which the given subprogram is attached, if exists. |
This class provides interface to collect and use lexical scoping information from machine instruction.
Definition at line 140 of file LexicalScopes.h.
|
default |
References LLVM_ABI.
bool LexicalScopes::dominates | ( | const DILocation * | DL, |
MachineBasicBlock * | MBB ) |
Return true if DebugLoc's lexical scope dominates at least one machine instruction's lexical scope in a given machine basic block.
Definition at line 320 of file LexicalScopes.cpp.
References assert(), DL, getMachineBasicBlocks(), and MBB.
|
inline |
Return true if there is any lexical scope information available.
Definition at line 158 of file LexicalScopes.h.
|
inline |
Find an abstract scope or return null.
Definition at line 185 of file LexicalScopes.h.
|
inline |
Find an inlined scope for the given scope/inlined-at.
Definition at line 191 of file LexicalScopes.h.
Referenced by llvm::DbgValueHistoryMap::trimLocationRanges().
|
inline |
Find regular lexical scope or return null.
Definition at line 197 of file LexicalScopes.h.
LexicalScope * LexicalScopes::findLexicalScope | ( | const DILocation * | DL | ) |
Find lexical scope, either regular or inlined, for the given DebugLoc.
findLexicalScope - Find lexical scope, either regular or inlined, for the given DebugLoc.
Return NULL if not found.
Definition at line 140 of file LexicalScopes.cpp.
References DL, findLexicalScope(), and I.
Referenced by findLexicalScope(), llvm::DbgValueHistoryMap::trimLocationRanges(), and validThroughout().
|
inline |
Return a reference to list of abstract scopes.
Definition at line 180 of file LexicalScopes.h.
|
inline |
Return lexical scope for the current function.
Definition at line 161 of file LexicalScopes.h.
|
inline |
Get function to which the given subprogram is attached, if exists.
Definition at line 206 of file LexicalScopes.h.
void LexicalScopes::getMachineBasicBlocks | ( | const DILocation * | DL, |
SmallPtrSetImpl< const MachineBasicBlock * > & | MBBs ) |
Populate given set using machine basic blocks which have machine instructions that belong to lexical scope identified by DebugLoc.
getMachineBasicBlocks - Populate given set using machine basic blocks which have machine instructions that belong to lexical scope identified by DebugLoc.
Definition at line 295 of file LexicalScopes.cpp.
References assert(), llvm::SmallPtrSetImplBase::clear(), DL, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert_range(), and llvm::make_pointer_range().
Referenced by dominates().
LexicalScope * LexicalScopes::getOrCreateAbstractScope | ( | const DILocalScope * | Scope | ) |
Find or create an abstract lexical scope.
getOrCreateAbstractScope - Find or create an abstract lexical scope.
Definition at line 227 of file LexicalScopes.cpp.
References assert(), llvm::Block, llvm::dyn_cast(), getOrCreateAbstractScope(), I, and llvm::isa().
Referenced by getOrCreateAbstractScope().
Scan module to build subprogram-to-function map.
Definition at line 59 of file LexicalScopes.cpp.
References F, resetModule(), and skipUnit().
void LexicalScopes::resetFunction | ( | ) |
Reset the instance so that it's prepared for another function.
Definition at line 49 of file LexicalScopes.cpp.
Referenced by resetModule(), and scanFunction().
void LexicalScopes::resetModule | ( | ) |
Reset the instance so that it's prepared for another module.
Definition at line 44 of file LexicalScopes.cpp.
References resetFunction().
Referenced by initialize().
void LexicalScopes::scanFunction | ( | const MachineFunction & | Fn | ) |
Scan machine function and constuct lexical scope nest, resets the instance if necessary.
Definition at line 68 of file LexicalScopes.cpp.
References llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), resetFunction(), and skipUnit().