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

Go to the source code of this file.

Functions

static DIScope * getNonCompileUnitScope (DIScope *N)
 If N is compile unit return NULL otherwise return N. More...
 
static DIImportedEntity * createImportedModule (LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, SmallVectorImpl< TrackingMDNodeRef > &AllImportedModules)
 
static ConstantAsMetadata * getConstantOrNull (Constant *C)
 
static DITemplateValueParameter * createTemplateValueParameterHelper (LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, Metadata *MD)
 
static DIType * createTypeWithFlags (const DIType *Ty, DINode::DIFlags FlagsToSet)
 
static void checkGlobalVariableScope (DIScope *Context)
 
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)
 
template<class... Ts>
static DISubprogram * getSubprogram (bool IsDistinct, Ts &&... Args)
 
static IRBuilder getIRBForDbgInsertion (const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore)
 Return an IRBuilder for inserting dbg.declare and dbg.value intrinsics. More...
 
static Value * getDbgIntrinsicValueImpl (LLVMContext &VMContext, Value *V)
 
static Function * getDeclareIntrin (Module &M)
 

Variables

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)
static

◆ createImportedModule()

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

◆ 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 
)
static

◆ createTemplateValueParameterHelper()

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

◆ createTypeWithFlags()

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

◆ getConstantOrNull()

static ConstantAsMetadata* getConstantOrNull ( Constant *  C)
static

◆ getDbgIntrinsicValueImpl()

static Value* getDbgIntrinsicValueImpl ( LLVMContext &  VMContext,
Value *  V 
)
static

Definition at line 901 of file DIBuilder.cpp.

References assert(), llvm::MetadataAsValue::get(), and llvm::ValueAsMetadata::get().

Referenced by getDeclareIntrin().

◆ getDeclareIntrin()

static Function* getDeclareIntrin ( Module &  M)
static

◆ getIRBForDbgInsertion()

static IRBuilder getIRBForDbgInsertion ( const DILocation *  DL,
BasicBlock *  InsertBB,
Instruction *  InsertBefore 
)
static

Return an IRBuilder for inserting dbg.declare and dbg.value intrinsics.

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

Definition at line 889 of file DIBuilder.cpp.

References B, and llvm::MDNode::getContext().

Referenced by getDeclareIntrin().

◆ getNonCompileUnitScope()

static DIScope* getNonCompileUnitScope ( DIScope *  N)
static

◆ getSubprogram()

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

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().