Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::LexicalScopes Class Reference

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.
LexicalScopegetCurrentFunctionScope () 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 LexicalScopefindLexicalScope (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.
LexicalScopefindAbstractScope (const DILocalScope *N)
 Find an abstract scope or return null.
LexicalScopefindInlinedScope (const DILocalScope *N, const DILocation *IA)
 Find an inlined scope for the given scope/inlined-at.
LexicalScopefindLexicalScope (const DILocalScope *N)
 Find regular lexical scope or return null.
LLVM_ABI LexicalScopegetOrCreateAbstractScope (const DILocalScope *Scope)
 Find or create an abstract lexical scope.
const FunctiongetFunction (const DISubprogram *SP) const
 Get function to which the given subprogram is attached, if exists.

Detailed Description

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

Definition at line 140 of file LexicalScopes.h.

Constructor & Destructor Documentation

◆ LexicalScopes()

llvm::LexicalScopes::LexicalScopes ( )
default

References LLVM_ABI.

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

References assert(), DL, getMachineBasicBlocks(), and MBB.

◆ empty()

bool llvm::LexicalScopes::empty ( )
inline

Return true if there is any lexical scope information available.

Definition at line 158 of file LexicalScopes.h.

◆ findAbstractScope()

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

Find an abstract scope or return null.

Definition at line 185 of file LexicalScopes.h.

References I, and N.

◆ findInlinedScope()

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

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

Definition at line 191 of file LexicalScopes.h.

References I, and N.

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

◆ findLexicalScope() [1/2]

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

Find regular lexical scope or return null.

Definition at line 197 of file LexicalScopes.h.

References I, and N.

◆ findLexicalScope() [2/2]

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

◆ getAbstractScopesList()

ArrayRef< LexicalScope * > llvm::LexicalScopes::getAbstractScopesList ( ) const
inline

Return a reference to list of abstract scopes.

Definition at line 180 of file LexicalScopes.h.

◆ getCurrentFunctionScope()

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

Return lexical scope for the current function.

Definition at line 161 of file LexicalScopes.h.

◆ getFunction()

const Function * llvm::LexicalScopes::getFunction ( const DISubprogram * SP) const
inline

Get function to which the given subprogram is attached, if exists.

Definition at line 206 of file LexicalScopes.h.

◆ getMachineBasicBlocks()

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

◆ getOrCreateAbstractScope()

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

◆ initialize()

void LexicalScopes::initialize ( const Module & M)

Scan module to build subprogram-to-function map.

Definition at line 59 of file LexicalScopes.cpp.

References F, resetModule(), and skipUnit().

◆ resetFunction()

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

◆ resetModule()

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

◆ scanFunction()

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


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