LLVM  15.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]
Collaboration diagram for llvm::DbgVariable:
Collaboration graph
[legend]

Public Member Functions

 DbgVariable (const DILocalVariable *V, const DILocation *IA)
 Frame index + expression. More...
 
void initializeMMI (const DIExpression *E, int FI)
 Initialize from the MMI table. More...
 
void initializeDbgValue (DbgValueLoc Value)
 
void initializeDbgValue (const MachineInstr *DbgValue)
 Initialize from a DBG_VALUE instruction. More...
 
const DILocalVariablegetVariable () const
 
const DIExpressiongetSingleExpression () const
 
void setDebugLocListIndex (unsigned O)
 
unsigned getDebugLocListIndex () const
 
void setDebugLocListTagOffset (uint8_t O)
 
Optional< uint8_t > getDebugLocListTagOffset () const
 
StringRef getName () const
 
const DbgValueLocgetValueLoc () const
 
ArrayRef< FrameIndexExpr > getFrameIndexExprs () const
 Get the FI entries, sorted by fragment offset. More...
 
bool hasFrameIndexExprs () const
 
void addMMIEntry (const DbgVariable &V)
 
dwarf::Tag getTag () const
 
bool isArtificial () const
 Return true if DbgVariable is artificial. More...
 
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. More...
 
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 223 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()

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 272 of file DwarfDebug.cpp.

References llvm::all_of(), assert(), B, and llvm::sort().

◆ getName()

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

◆ getSingleExpression()

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

Definition at line 170 of file DwarfDebug.h.

References assert().

Referenced by llvm::DwarfCompileUnit::addComplexAddress().

◆ getTag()

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

Definition at line 187 of file DwarfDebug.h.

References getVariable().

◆ getType()

const DIType * DbgVariable::getType ( ) const

◆ getValueLoc()

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

Definition at line 180 of file DwarfDebug.h.

◆ getVariable()

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

◆ hasComplexAddress()

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

Definition at line 212 of file DwarfDebug.h.

References assert().

Referenced by llvm::DwarfCompileUnit::addVariableAddress().

◆ hasFrameIndexExprs()

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

Definition at line 183 of file DwarfDebug.h.

◆ initializeDbgValue() [1/2]

void DbgVariable::initializeDbgValue ( const MachineInstr DbgValue)

Initialize from a DBG_VALUE instruction.

Definition at line 258 of file DwarfDebug.cpp.

References assert(), E, getDebugLocValue(), llvm::DbgEntity::getInlinedAt(), and getVariable().

◆ initializeDbgValue() [2/2]

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

Definition at line 151 of file DwarfDebug.h.

References assert(), and E.

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

◆ 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, and llvm::max().

◆ isArtificial()

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

Return true if DbgVariable is artificial.

Definition at line 196 of file DwarfDebug.h.

References getType(), and getVariable().

Referenced by llvm::DwarfCompileUnit::applyVariableAttributes().

◆ isObjectPointer()

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

Definition at line 204 of file DwarfDebug.h.

References getType(), and getVariable().

Referenced by llvm::DwarfCompileUnit::constructVariableDIE().

◆ setDebugLocListIndex()

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

Definition at line 175 of file DwarfDebug.h.

References llvm::RISCVFenceField::O.

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

◆ setDebugLocListTagOffset()

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

Definition at line 177 of file DwarfDebug.h.

References llvm::RISCVFenceField::O.

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


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