LLVM 20.0.0git
Classes | Namespaces | Typedefs | Functions
DebugInfo.h File Reference
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PassManager.h"
#include <optional>

Go to the source code of this file.

Classes

class  llvm::DebugInfoFinder
 Utility to find all debug info in a module. More...
 
class  llvm::at::DbgAssignIt
 High level: this is an iterator for llvm.dbg.assign intrinsics. More...
 
struct  llvm::at::VarRecord
 Helper struct for trackAssignments, below. More...
 
struct  llvm::DenseMapInfo< at::VarRecord >
 
struct  llvm::at::AssignmentInfo
 Describes properties of a store that has a static size and offset into a some base storage. More...
 
class  llvm::AssignmentTrackingPass
 Convert @llvm.dbg.declare intrinsics into sets of @llvm.dbg.assign intrinsics by treating stores to the dbg.declare'd address as assignments to the variable. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::at
 Assignment Tracking (at).
 

Typedefs

using llvm::at::AssignmentInstRange = iterator_range< SmallVectorImpl< Instruction * >::iterator >
 A range of instructions.
 
using llvm::at::AssignmentMarkerRange = iterator_range< DbgAssignIt >
 A range of llvm.dbg.assign intrinsics.
 
using llvm::at::StorageToVarsMap = DenseMap< const AllocaInst *, SmallSetVector< VarRecord, 2 > >
 Map of backing storage to a set of variables that are stored to it.
 

Functions

TinyPtrVector< DbgDeclareInst * > llvm::findDbgDeclares (Value *V)
 Finds dbg.declare intrinsics declaring local variables as living in the memory that 'V' points to.
 
TinyPtrVector< DbgVariableRecord * > llvm::findDVRDeclares (Value *V)
 As above, for DVRDeclares.
 
void llvm::findDbgValues (SmallVectorImpl< DbgValueInst * > &DbgValues, Value *V, SmallVectorImpl< DbgVariableRecord * > *DbgVariableRecords=nullptr)
 Finds the llvm.dbg.value intrinsics describing a value.
 
void llvm::findDbgUsers (SmallVectorImpl< DbgVariableIntrinsic * > &DbgInsts, Value *V, SmallVectorImpl< DbgVariableRecord * > *DbgVariableRecords=nullptr)
 Finds the debug info intrinsics describing a value.
 
DISubprogramllvm::getDISubprogram (const MDNode *Scope)
 Find subprogram that is enclosing this scope.
 
DebugLoc llvm::getDebugValueLoc (DbgVariableIntrinsic *DII)
 Produce a DebugLoc to use for each dbg.declare that is promoted to a dbg.value.
 
DebugLoc llvm::getDebugValueLoc (DbgVariableRecord *DVR)
 
bool llvm::StripDebugInfo (Module &M)
 Strip debug info in the module if it exists.
 
bool llvm::stripDebugInfo (Function &F)
 
bool llvm::stripNonLineTableDebugInfo (Module &M)
 Downgrade the debug info in a module to contain only line table information.
 
void llvm::updateLoopMetadataDebugLocations (Instruction &I, function_ref< Metadata *(Metadata *)> Updater)
 Update the debug locations contained within the MD_loop metadata attached to the instruction I, if one exists.
 
unsigned llvm::getDebugMetadataVersionFromModule (const Module &M)
 Return Debug Info Metadata Version by checking module flags.
 
AssignmentInstRange llvm::at::getAssignmentInsts (DIAssignID *ID)
 Return a range of instructions (typically just one) that have ID as an attachment.
 
AssignmentInstRange llvm::at::getAssignmentInsts (const DbgAssignIntrinsic *DAI)
 Return a range of instructions (typically just one) that perform the assignment that DAI encodes.
 
AssignmentInstRange llvm::at::getAssignmentInsts (const DbgVariableRecord *DVR)
 
AssignmentMarkerRange llvm::at::getAssignmentMarkers (DIAssignID *ID)
 Return a range of dbg.assign intrinsics which use \ID as an operand.
 
AssignmentMarkerRange llvm::at::getAssignmentMarkers (const Instruction *Inst)
 Return a range of dbg.assign intrinsics for which Inst performs the assignment they encode.
 
SmallVector< DbgVariableRecord * > llvm::at::getDVRAssignmentMarkers (const Instruction *Inst)
 
void llvm::at::deleteAssignmentMarkers (const Instruction *Inst)
 Delete the llvm.dbg.assign intrinsics linked to Inst.
 
void llvm::at::RAUW (DIAssignID *Old, DIAssignID *New)
 Replace all uses (and attachments) of Old with New.
 
void llvm::at::deleteAll (Function *F)
 Remove all Assignment Tracking related intrinsics and metadata from F.
 
bool llvm::at::calculateFragmentIntersect (const DataLayout &DL, const Value *Dest, uint64_t SliceOffsetInBits, uint64_t SliceSizeInBits, const DbgAssignIntrinsic *DbgAssign, std::optional< DIExpression::FragmentInfo > &Result)
 Calculate the fragment of the variable in DAI covered from (Dest + SliceOffsetInBits) to to (Dest + SliceOffsetInBits + SliceSizeInBits)
 
bool llvm::at::calculateFragmentIntersect (const DataLayout &DL, const Value *Dest, uint64_t SliceOffsetInBits, uint64_t SliceSizeInBits, const DbgVariableRecord *DVRAssign, std::optional< DIExpression::FragmentInfo > &Result)
 FIXME: Remove this wrapper function and call DIExpression::calculateFragmentIntersect directly.
 
void llvm::at::remapAssignID (DenseMap< DIAssignID *, DIAssignID * > &Map, Instruction &I)
 Replace DIAssignID uses and attachments with IDs from Map.
 
void llvm::at::trackAssignments (Function::iterator Start, Function::iterator End, const StorageToVarsMap &Vars, const DataLayout &DL, bool DebugPrints=false)
 Track assignments to Vars between Start and End.
 
std::optional< AssignmentInfollvm::at::getAssignmentInfo (const DataLayout &DL, const MemIntrinsic *I)
 
std::optional< AssignmentInfollvm::at::getAssignmentInfo (const DataLayout &DL, const StoreInst *SI)
 
std::optional< AssignmentInfollvm::at::getAssignmentInfo (const DataLayout &DL, const AllocaInst *AI)
 
bool llvm::isAssignmentTrackingEnabled (const Module &M)
 Return true if assignment tracking is enabled for module M.