LLVM 22.0.0git
llvm::DebugInfoFinder Class Reference

Utility to find all debug info in a module. More...

#include "llvm/IR/DebugInfo.h"

Public Types

using compile_unit_iterator
using subprogram_iterator = SmallVectorImpl<DISubprogram *>::const_iterator
using global_variable_expression_iterator
using type_iterator = SmallVectorImpl<DIType *>::const_iterator
using scope_iterator = SmallVectorImpl<DIScope *>::const_iterator

Public Member Functions

LLVM_ABI void processModule (const Module &M)
 Process entire module and collect debug info anchors.
LLVM_ABI void processInstruction (const Module &M, const Instruction &I)
 Process a single instruction and collect debug info anchors.
LLVM_ABI void processVariable (DILocalVariable *DVI)
 Process a DILocalVariable.
LLVM_ABI void processLocation (const Module &M, const DILocation *Loc)
 Process debug info location.
LLVM_ABI void processDbgRecord (const Module &M, const DbgRecord &DR)
 Process a DbgRecord.
LLVM_ABI void processSubprogram (DISubprogram *SP)
 Process subprogram.
LLVM_ABI void reset ()
 Clear all lists.
iterator_range< compile_unit_iteratorcompile_units () const
iterator_range< subprogram_iteratorsubprograms () const
iterator_range< global_variable_expression_iteratorglobal_variables () const
iterator_range< type_iteratortypes () const
iterator_range< scope_iteratorscopes () const
unsigned compile_unit_count () const
unsigned global_variable_count () const
unsigned subprogram_count () const
unsigned type_count () const
unsigned scope_count () const

Detailed Description

Utility to find all debug info in a module.

DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder uses processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs.

Definition at line 103 of file DebugInfo.h.

Member Typedef Documentation

◆ compile_unit_iterator

Initial value:

Definition at line 135 of file DebugInfo.h.

◆ global_variable_expression_iterator

◆ scope_iterator

◆ subprogram_iterator

◆ type_iterator

Member Function Documentation

◆ compile_unit_count()

unsigned llvm::DebugInfoFinder::compile_unit_count ( ) const
inline

Definition at line 163 of file DebugInfo.h.

◆ compile_units()

iterator_range< compile_unit_iterator > llvm::DebugInfoFinder::compile_units ( ) const
inline

◆ global_variable_count()

unsigned llvm::DebugInfoFinder::global_variable_count ( ) const
inline

Definition at line 164 of file DebugInfo.h.

◆ global_variables()

iterator_range< global_variable_expression_iterator > llvm::DebugInfoFinder::global_variables ( ) const
inline

Definition at line 151 of file DebugInfo.h.

References llvm::make_range().

Referenced by printModuleDebugInfo().

◆ processDbgRecord()

void DebugInfoFinder::processDbgRecord ( const Module & M,
const DbgRecord & DR )

◆ processInstruction()

void DebugInfoFinder::processInstruction ( const Module & M,
const Instruction & I )

Process a single instruction and collect debug info anchors.

Definition at line 201 of file DebugInfo.cpp.

References llvm::dyn_cast(), I, processDbgRecord(), processLocation(), and processVariable().

Referenced by processModule(), and stripDeadDebugInfoImpl().

◆ processLocation()

void DebugInfoFinder::processLocation ( const Module & M,
const DILocation * Loc )

Process debug info location.

Definition at line 213 of file DebugInfo.cpp.

References processLocation().

Referenced by processDbgRecord(), processInstruction(), and processLocation().

◆ processModule()

void DebugInfoFinder::processModule ( const Module & M)

Process entire module and collect debug info anchors.

Definition at line 166 of file DebugInfo.cpp.

References llvm::cast_or_null(), F, I, processInstruction(), and processSubprogram().

◆ processSubprogram()

void DebugInfoFinder::processSubprogram ( DISubprogram * SP)

Process subprogram.

Definition at line 288 of file DebugInfo.cpp.

References llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::Import, N, and processVariable().

Referenced by processModule(), and stripDeadDebugInfoImpl().

◆ processVariable()

void DebugInfoFinder::processVariable ( DILocalVariable * DVI)

◆ reset()

void DebugInfoFinder::reset ( )

Clear all lists.

Definition at line 157 of file DebugInfo.cpp.

◆ scope_count()

unsigned llvm::DebugInfoFinder::scope_count ( ) const
inline

Definition at line 167 of file DebugInfo.h.

◆ scopes()

iterator_range< scope_iterator > llvm::DebugInfoFinder::scopes ( ) const
inline

Definition at line 159 of file DebugInfo.h.

References llvm::make_range().

◆ subprogram_count()

unsigned llvm::DebugInfoFinder::subprogram_count ( ) const
inline

Definition at line 165 of file DebugInfo.h.

◆ subprograms()

iterator_range< subprogram_iterator > llvm::DebugInfoFinder::subprograms ( ) const
inline

Definition at line 147 of file DebugInfo.h.

References llvm::make_range().

Referenced by printModuleDebugInfo().

◆ type_count()

unsigned llvm::DebugInfoFinder::type_count ( ) const
inline

Definition at line 166 of file DebugInfo.h.

◆ types()

iterator_range< type_iterator > llvm::DebugInfoFinder::types ( ) const
inline

Definition at line 155 of file DebugInfo.h.

References llvm::make_range().

Referenced by printModuleDebugInfo().


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