LLVM 22.0.0git
Public Member Functions | List of all members
llvm::LexicalScopes Class Reference

LexicalScopes - 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 MachineFunction &)
 initialize - Scan machine function and constuct lexical scope nest, resets the instance if necessary.
 
LLVM_ABI void reset ()
 releaseMemory - release memory.
 
bool empty ()
 empty - Return true if there is any lexical scope information available.
 
LexicalScopegetCurrentFunctionScope () const
 getCurrentFunctionScope - Return lexical scope for the current function.
 
LLVM_ABI void getMachineBasicBlocks (const DILocation *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.
 
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 LexicalScopefindLexicalScope (const DILocation *DL)
 findLexicalScope - Find lexical scope, either regular or inlined, for the given DebugLoc.
 
ArrayRef< LexicalScope * > getAbstractScopesList () const
 getAbstractScopesList - Return a reference to list of abstract scopes.
 
LexicalScopefindAbstractScope (const DILocalScope *N)
 findAbstractScope - Find an abstract scope or return null.
 
LexicalScopefindInlinedScope (const DILocalScope *N, const DILocation *IA)
 findInlinedScope - Find an inlined scope for the given scope/inlined-at.
 
LexicalScopefindLexicalScope (const DILocalScope *N)
 findLexicalScope - Find regular lexical scope or return null.
 
LLVM_ABI LexicalScopegetOrCreateAbstractScope (const DILocalScope *Scope)
 getOrCreateAbstractScope - Find or create an abstract lexical scope.
 

Detailed Description

LexicalScopes - This class provides interface to collect and use lexical scoping information from machine instruction.

Definition at line 142 of file LexicalScopes.h.

Constructor & Destructor Documentation

◆ LexicalScopes()

llvm::LexicalScopes::LexicalScopes ( )
default

Member Function Documentation

◆ dominates()

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 305 of file LexicalScopes.cpp.

References assert(), DL, getMachineBasicBlocks(), llvm::MachineBasicBlock::getParent(), and MBB.

◆ empty()

bool llvm::LexicalScopes::empty ( )
inline

empty - Return true if there is any lexical scope information available.

Definition at line 154 of file LexicalScopes.h.

Referenced by llvm::DebugHandlerBase::beginFunction(), and llvm::DwarfDebug::beginFunctionImpl().

◆ findAbstractScope()

LexicalScope * llvm::LexicalScopes::findAbstractScope ( const DILocalScope N)
inline

findAbstractScope - Find an abstract scope or return null.

Definition at line 182 of file LexicalScopes.h.

References I, and N.

◆ findInlinedScope()

LexicalScope * llvm::LexicalScopes::findInlinedScope ( const DILocalScope N,
const DILocation IA 
)
inline

findInlinedScope - Find an inlined scope for the given scope/inlined-at.

Definition at line 188 of file LexicalScopes.h.

References I, and N.

Referenced by llvm::DbgValueHistoryMap::trimLocationRanges().

◆ findLexicalScope() [1/2]

LexicalScope * llvm::LexicalScopes::findLexicalScope ( const DILocalScope N)
inline

findLexicalScope - Find regular lexical scope or return null.

Definition at line 194 of file LexicalScopes.h.

References I, and N.

◆ findLexicalScope() [2/2]

LexicalScope * LexicalScopes::findLexicalScope ( const DILocation DL)

findLexicalScope - Find lexical scope, either regular or inlined, for the given DebugLoc.

Return NULL if not found.

Definition at line 124 of file LexicalScopes.cpp.

References DL, findLexicalScope(), and I.

Referenced by findLexicalScope(), llvm::DbgValueHistoryMap::trimLocationRanges(), and validThroughout().

◆ getAbstractScopesList()

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::endFunctionImpl().

◆ getCurrentFunctionScope()

LexicalScope * llvm::LexicalScopes::getCurrentFunctionScope ( ) const
inline

getCurrentFunctionScope - Return lexical scope for the current function.

Definition at line 157 of file LexicalScopes.h.

Referenced by llvm::DwarfDebug::beginFunctionImpl(), llvm::CodeViewDebug::endFunctionImpl(), llvm::DwarfDebug::endFunctionImpl(), and llvm::DebugHandlerBase::identifyScopeMarkers().

◆ getMachineBasicBlocks()

void LexicalScopes::getMachineBasicBlocks ( const DILocation 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 280 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().

◆ getOrCreateAbstractScope()

LexicalScope * LexicalScopes::getOrCreateAbstractScope ( const DILocalScope Scope)

getOrCreateAbstractScope - Find or create an abstract lexical scope.

Definition at line 212 of file LexicalScopes.cpp.

References assert(), llvm::Block, getOrCreateAbstractScope(), and I.

Referenced by llvm::DwarfDebug::endFunctionImpl(), and getOrCreateAbstractScope().

◆ initialize()

void LexicalScopes::initialize ( const MachineFunction Fn)

initialize - Scan machine function and constuct lexical scope nest, resets the instance if necessary.

initialize - Scan machine function and constuct lexical scope nest.

Definition at line 51 of file LexicalScopes.cpp.

References llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), llvm::DICompileUnit::NoDebug, and reset().

Referenced by llvm::DebugHandlerBase::beginFunction().

◆ reset()

void LexicalScopes::reset ( )

releaseMemory - release memory.

reset - Reset the instance so that it's prepared for another function.

Definition at line 40 of file LexicalScopes.cpp.

Referenced by initialize().


The documentation for this class was generated from the following files: