LLVM API Documentation
#include <LexicalScopes.h>
Public Member Functions | |
LexicalScopes () | |
void | initialize (const MachineFunction &) |
initialize - Scan machine function and constuct lexical scope nest. | |
void | reset () |
releaseMemory - release memory. | |
bool | empty () |
empty - Return true if there is any lexical scope information available. | |
bool | isCurrentFunctionScope (const LexicalScope *LS) |
LexicalScope * | getCurrentFunctionScope () const |
getCurrentFunctionScope - Return lexical scope for the current function. | |
void | getMachineBasicBlocks (DebugLoc DL, SmallPtrSetImpl< const MachineBasicBlock * > &MBBs) |
bool | dominates (DebugLoc DL, MachineBasicBlock *MBB) |
LexicalScope * | findLexicalScope (DebugLoc DL) |
ArrayRef< LexicalScope * > | getAbstractScopesList () const |
getAbstractScopesList - Return a reference to list of abstract scopes. | |
LexicalScope * | findAbstractScope (const MDNode *N) |
findAbstractScope - Find an abstract scope or return null. | |
LexicalScope * | findInlinedScope (DebugLoc DL) |
LexicalScope * | findLexicalScope (const MDNode *N) |
findLexicalScope - Find regular lexical scope or return null. | |
void | dump () |
dump - Print data structures to dbgs(). | |
LexicalScope * | getOrCreateAbstractScope (const MDNode *N) |
getOrCreateAbstractScope - Find or create an abstract lexical scope. |
LexicalScopes - This class provides interface to collect and use lexical scoping information from machine instruction.
Definition at line 137 of file LexicalScopes.h.
llvm::LexicalScopes::LexicalScopes | ( | ) | [inline] |
Definition at line 139 of file LexicalScopes.h.
bool LexicalScopes::dominates | ( | DebugLoc | DL, |
MachineBasicBlock * | MBB | ||
) |
dominates - 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 311 of file LexicalScopes.cpp.
References llvm::MachineBasicBlock::begin(), llvm::LexicalScope::dominates(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getParent(), I, and llvm::DebugLoc::isUnknown().
void llvm::LexicalScopes::dump | ( | ) |
dump - Print data structures to dbgs().
bool llvm::LexicalScopes::empty | ( | ) | [inline] |
empty - Return true if there is any lexical scope information available.
Definition at line 149 of file LexicalScopes.h.
Referenced by llvm::DwarfDebug::beginFunction(), and llvm::DwarfDebug::endFunction().
LexicalScope* llvm::LexicalScopes::findAbstractScope | ( | const MDNode * | N | ) | [inline] |
findAbstractScope - Find an abstract scope or return null.
Definition at line 182 of file LexicalScopes.h.
References I.
findInlinedScope - Find an inlined scope for the given DebugLoc or return NULL.
Definition at line 107 of file LexicalScopes.cpp.
References llvm::Function::getContext(), llvm::MDNode::getFunction(), llvm::DebugLoc::getScopeAndInlinedAt(), and I.
findLexicalScope - Find lexical scope, either regular or inlined, for the given DebugLoc. Return NULL if not found.
Definition at line 117 of file LexicalScopes.cpp.
References llvm::Function::getContext(), llvm::MDNode::getFunction(), llvm::DILexicalBlockFile::getScope(), llvm::DebugLoc::getScopeAndInlinedAt(), I, and llvm::DIDescriptor::isLexicalBlockFile().
LexicalScope* llvm::LexicalScopes::findLexicalScope | ( | const MDNode * | N | ) | [inline] |
findLexicalScope - Find regular lexical scope or return null.
Definition at line 192 of file LexicalScopes.h.
References I.
ArrayRef<LexicalScope *> llvm::LexicalScopes::getAbstractScopesList | ( | ) | const [inline] |
getAbstractScopesList - Return a reference to list of abstract scopes.
Definition at line 177 of file LexicalScopes.h.
Referenced by llvm::DwarfDebug::endFunction().
LexicalScope* llvm::LexicalScopes::getCurrentFunctionScope | ( | ) | const [inline] |
getCurrentFunctionScope - Return lexical scope for the current function.
Definition at line 158 of file LexicalScopes.h.
Referenced by llvm::DwarfDebug::beginFunction(), and llvm::DwarfDebug::endFunction().
void LexicalScopes::getMachineBasicBlocks | ( | DebugLoc | DL, |
SmallPtrSetImpl< const MachineBasicBlock * > & | MBBs | ||
) |
getMachineBasicBlocks - Populate given set using machine basic blocks which have machine instructions that belong to lexical scope identified by DebugLoc.
Definition at line 287 of file LexicalScopes.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallPtrSetImplBase::clear(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::LexicalScope::getRanges(), I, and llvm::SmallPtrSetImpl< PtrType >::insert().
getOrCreateAbstractScope - Find or create an abstract lexical scope.
Definition at line 207 of file LexicalScopes.cpp.
References llvm::DILexicalBlock::getContext(), llvm::DILexicalBlockFile::getScope(), if(), llvm::DIDescriptor::isLexicalBlock(), llvm::DIDescriptor::isLexicalBlockFile(), llvm::DIDescriptor::isSubprogram(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
void LexicalScopes::initialize | ( | const MachineFunction & | Fn | ) |
initialize - Scan machine function and constuct lexical scope nest.
initialize - Scan machine function and constuct lexical scope nest, resets the instance if necessary.
Definition at line 40 of file LexicalScopes.cpp.
References reset().
Referenced by llvm::DwarfDebug::beginFunction().
bool llvm::LexicalScopes::isCurrentFunctionScope | ( | const LexicalScope * | LS | ) | [inline] |
isCurrentFunctionScope - Return true if given lexical scope represents current function.
Definition at line 153 of file LexicalScopes.h.
void LexicalScopes::reset | ( | ) |
releaseMemory - release memory.
reset - Reset the instance so that it's prepared for another function.
Definition at line 30 of file LexicalScopes.cpp.
References llvm::SmallVectorImpl< T >::clear().
Referenced by initialize().