LLVM 17.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::DbgVariable Class Reference

This class is used to track local variable information. More...

#include "CodeGen/AsmPrinter/DwarfDebug.h"

Inheritance diagram for llvm::DbgVariable:
Inheritance graph
[legend]

Public Member Functions

 DbgVariable (const DILocalVariable *V, const DILocation *IA)
 Frame index + expression.
 
void initializeMMI (const DIExpression *E, int FI)
 Initialize from the MMI table.
 
void initializeDbgValue (DbgValueLoc Value)
 
void initializeDbgValue (const MachineInstr *DbgValue)
 Initialize from a DBG_VALUE instruction.
 
const DILocalVariablegetVariable () const
 
const DIExpressiongetSingleExpression () const
 
void setDebugLocListIndex (unsigned O)
 
unsigned getDebugLocListIndex () const
 
void setDebugLocListTagOffset (uint8_t O)
 
std::optional< uint8_t > getDebugLocListTagOffset () const
 
StringRef getName () const
 
const DbgValueLocgetValueLoc () const
 
ArrayRef< FrameIndexExpr > getFrameIndexExprs () const
 Get the FI entries, sorted by fragment offset.
 
bool hasFrameIndexExprs () const
 
void addMMIEntry (const DbgVariable &V)
 
dwarf::Tag getTag () const
 
bool isArtificial () const
 Return true if DbgVariable is artificial.
 
bool isObjectPointer () const
 
bool hasComplexAddress () const
 
const DITypegetType () const
 
- Public Member Functions inherited from llvm::DbgEntity
 DbgEntity (const DINode *N, const DILocation *IA, DbgEntityKind ID)
 
virtual ~DbgEntity ()=default
 
void setDIE (DIE &D)
 
const DINodegetEntity () const
 Accessors.
 
const DILocationgetInlinedAt () const
 
DIEgetDIE () const
 
DbgEntityKind getDbgEntityID () const
 

Static Public Member Functions

static bool classof (const DbgEntity *N)
 
- Static Public Member Functions inherited from llvm::DbgEntity
static bool classof (const DbgEntity *N)
 

Additional Inherited Members

- Public Types inherited from llvm::DbgEntity
enum  DbgEntityKind { DbgVariableKind , DbgLabelKind }
 

Detailed Description

This class is used to track local variable information.

Variables can be created from allocas, in which case they're generated from the MMI table. Such variables can have multiple expressions and frame indices.

Variables can be created from DBG_VALUE instructions. Those whose location changes over time use DebugLocListIndex, while those with a single location use ValueLoc and (optionally) a single entry of Expr.

Variables that have been optimized out use none of these fields.

Definition at line 115 of file DwarfDebug.h.

Constructor & Destructor Documentation

◆ DbgVariable()

llvm::DbgVariable::DbgVariable ( const DILocalVariable V,
const DILocation IA 
)
inline

Frame index + expression.

Construct a DbgVariable.

Creates a variable without any DW_AT_location. Call initializeMMI() for MMI entries, or initializeDbgValue() for DBG_VALUE instructions.

Definition at line 136 of file DwarfDebug.h.

Member Function Documentation

◆ addMMIEntry()

void DbgVariable::addMMIEntry ( const DbgVariable V)

◆ classof()

static bool llvm::DbgVariable::classof ( const DbgEntity N)
inlinestatic

Definition at line 225 of file DwarfDebug.h.

References llvm::DbgEntity::DbgVariableKind, and N.

◆ getDebugLocListIndex()

unsigned llvm::DbgVariable::getDebugLocListIndex ( ) const
inline

Definition at line 176 of file DwarfDebug.h.

◆ getDebugLocListTagOffset()

std::optional< uint8_t > llvm::DbgVariable::getDebugLocListTagOffset ( ) const
inline

Definition at line 178 of file DwarfDebug.h.

◆ getFrameIndexExprs()

ArrayRef< DbgVariable::FrameIndexExpr > DbgVariable::getFrameIndexExprs ( ) const

Get the FI entries, sorted by fragment offset.

Definition at line 273 of file DwarfDebug.cpp.

References A, llvm::all_of(), assert(), B, llvm::SmallVectorBase< Size_T >::size(), and llvm::sort().

◆ getName()

StringRef llvm::DbgVariable::getName ( ) const
inline

◆ getSingleExpression()

const DIExpression * llvm::DbgVariable::getSingleExpression ( ) const
inline

◆ getTag()

dwarf::Tag llvm::DbgVariable::getTag ( ) const
inline

Definition at line 189 of file DwarfDebug.h.

References getVariable().

◆ getType()

const DIType * DbgVariable::getType ( ) const

◆ getValueLoc()

const DbgValueLoc * llvm::DbgVariable::getValueLoc ( ) const
inline

Definition at line 182 of file DwarfDebug.h.

◆ getVariable()

const DILocalVariable * llvm::DbgVariable::getVariable ( ) const
inline

◆ hasComplexAddress()

bool llvm::DbgVariable::hasComplexAddress ( ) const
inline

◆ hasFrameIndexExprs()

bool llvm::DbgVariable::hasFrameIndexExprs ( ) const
inline

Definition at line 185 of file DwarfDebug.h.

References llvm::SmallVectorBase< Size_T >::empty().

◆ initializeDbgValue() [1/2]

void DbgVariable::initializeDbgValue ( const MachineInstr DbgValue)

◆ initializeDbgValue() [2/2]

void llvm::DbgVariable::initializeDbgValue ( DbgValueLoc  Value)
inline

◆ initializeMMI()

void llvm::DbgVariable::initializeMMI ( const DIExpression E,
int  FI 
)
inline

Initialize from the MMI table.

Definition at line 140 of file DwarfDebug.h.

References assert(), E, llvm::SmallVectorBase< Size_T >::empty(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ isArtificial()

bool llvm::DbgVariable::isArtificial ( ) const
inline

Return true if DbgVariable is artificial.

Definition at line 198 of file DwarfDebug.h.

References getType(), getVariable(), and isArtificial().

Referenced by llvm::DwarfCompileUnit::applyVariableAttributes(), and isArtificial().

◆ isObjectPointer()

bool llvm::DbgVariable::isObjectPointer ( ) const
inline

◆ setDebugLocListIndex()

void llvm::DbgVariable::setDebugLocListIndex ( unsigned  O)
inline

Definition at line 175 of file DwarfDebug.h.

Referenced by llvm::DebugLocStream::ListBuilder::~ListBuilder().

◆ setDebugLocListTagOffset()

void llvm::DbgVariable::setDebugLocListTagOffset ( uint8_t  O)
inline

Definition at line 177 of file DwarfDebug.h.

Referenced by llvm::DebugLocStream::ListBuilder::~ListBuilder().


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