LLVM  16.0.0git
Functions | Variables
DIBuilder.cpp File Reference
#include "llvm/IR/DIBuilder.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/Optional.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
Include dependency graph for DIBuilder.cpp:

Go to the source code of this file.


static DIScopegetNonCompileUnitScope (DIScope *N)
 If N is compile unit return NULL otherwise return N. More...
static DIImportedEntitycreateImportedModule (LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, DINodeArray Elements, SmallVectorImpl< TrackingMDNodeRef > &AllImportedModules)
static ConstantAsMetadatagetConstantOrNull (Constant *C)
static DITemplateValueParametercreateTemplateValueParameterHelper (LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, bool IsDefault, Metadata *MD)
static DITypecreateTypeWithFlags (const DIType *Ty, DINode::DIFlags FlagsToSet)
static void checkGlobalVariableScope (DIScope *Context)
static DILocalVariablecreateLocalVariable (LLVMContext &VMContext, DenseMap< MDNode *, SmallVector< TrackingMDNodeRef, 1 >> &PreservedVariables, DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags, uint32_t AlignInBits, DINodeArray Annotations=nullptr)
template<class... Ts>
static DISubprogramgetSubprogram (bool IsDistinct, Ts &&...Args)
static void initIRBuilder (IRBuilder<> &Builder, const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore)
 Initialize IRBuilder for inserting dbg.declare and dbg.value intrinsics. More...
static ValuegetDbgIntrinsicValueImpl (LLVMContext &VMContext, Value *V)
static FunctiongetDeclareIntrin (Module &M)


static cl::opt< bool > UseDbgAddr ("use-dbg-addr", llvm::cl::desc("Use llvm.dbg.addr for all local variables"), cl::init(false), cl::Hidden)

Function Documentation

◆ checkGlobalVariableScope()

static void checkGlobalVariableScope ( DIScope Context)

◆ createImportedModule()

static DIImportedEntity* createImportedModule ( LLVMContext C,
dwarf::Tag  Tag,
DIScope Context,
Metadata NS,
DIFile File,
unsigned  Line,
StringRef  Name,
DINodeArray  Elements,
SmallVectorImpl< TrackingMDNodeRef > &  AllImportedModules 

◆ createLocalVariable()

static DILocalVariable* createLocalVariable ( LLVMContext VMContext,
DenseMap< MDNode *, SmallVector< TrackingMDNodeRef, 1 >> &  PreservedVariables,
DIScope Scope,
StringRef  Name,
unsigned  ArgNo,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  AlwaysPreserve,
DINode::DIFlags  Flags,
uint32_t  AlignInBits,
DINodeArray  Annotations = nullptr 

◆ createTemplateValueParameterHelper()

static DITemplateValueParameter* createTemplateValueParameterHelper ( LLVMContext VMContext,
unsigned  Tag,
DIScope Context,
StringRef  Name,
DIType Ty,
bool  IsDefault,
Metadata MD 

◆ createTypeWithFlags()

static DIType* createTypeWithFlags ( const DIType Ty,
DINode::DIFlags  FlagsToSet 

◆ getConstantOrNull()

static ConstantAsMetadata* getConstantOrNull ( Constant C)

◆ getDbgIntrinsicValueImpl()

static Value* getDbgIntrinsicValueImpl ( LLVMContext VMContext,
Value V 

◆ getDeclareIntrin()

static Function* getDeclareIntrin ( Module M)

Definition at line 1058 of file DIBuilder.cpp.

References llvm::Intrinsic::getDeclaration(), M, and UseDbgAddr.

◆ getNonCompileUnitScope()

static DIScope* getNonCompileUnitScope ( DIScope N)

◆ getSubprogram()

template<class... Ts>
static DISubprogram* getSubprogram ( bool  IsDistinct,
Ts &&...  Args 

◆ initIRBuilder()

static void initIRBuilder ( IRBuilder<> &  Builder,
const DILocation DL,
BasicBlock InsertBB,
Instruction InsertBefore 

Initialize IRBuilder for inserting dbg.declare and dbg.value intrinsics.

This abstracts over the various ways to specify an insert position.

Definition at line 1044 of file DIBuilder.cpp.

References Builder, and DL.

Variable Documentation

◆ UseDbgAddr

cl::opt<bool> UseDbgAddr("use-dbg-addr", llvm::cl::desc("Use llvm.dbg.addr for all local variables"), cl::init(false), cl::Hidden)

Referenced by getDeclareIntrin().