LLVM  15.0.0git
Macros | Functions
DebugInfo.cpp File Reference
#include "llvm-c/DebugInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GVMaterializer.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Casting.h"
#include <algorithm>
#include <cassert>
#include <utility>
#include "llvm/BinaryFormat/Dwarf.def"
#include "llvm/IR/Metadata.def"
Include dependency graph for DebugInfo.cpp:

Go to the source code of this file.

Macros

#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR)
 
#define HANDLE_METADATA_LEAF(CLASS)
 

Functions

static MDNodeupdateLoopMetadataDebugLocationsImpl (MDNode *OrigLoopID, function_ref< Metadata *(Metadata *)> Updater)
 
static bool isDILocationReachable (SmallPtrSetImpl< Metadata * > &Visited, SmallPtrSetImpl< Metadata * > &Reachable, Metadata *MD)
 Return true if a node is a DILocation or if a DILocation is indirectly referenced by one of the node's children. More...
 
static MDNodestripDebugLocFromLoopID (MDNode *N)
 
static unsigned map_from_llvmDWARFsourcelanguage (LLVMDWARFSourceLanguage lang)
 
template<typename DIT >
DIT * unwrapDI (LLVMMetadataRef Ref)
 
static DINode::DIFlags map_from_llvmDIFlags (LLVMDIFlags Flags)
 
static LLVMDIFlags map_to_llvmDIFlags (DINode::DIFlags Flags)
 
static DISubprogram::DISPFlags pack_into_DISPFlags (bool IsLocalToUnit, bool IsDefinition, bool IsOptimized)
 
unsigned LLVMDebugMetadataVersion ()
 The current debug metadata version number. More...
 
LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved (LLVMModuleRef M)
 Construct a builder for a module, and do not allow for unresolved nodes attached to the module. More...
 
LLVMDIBuilderRef LLVMCreateDIBuilder (LLVMModuleRef M)
 Construct a builder for a module and collect unresolved nodes attached to the module in order to resolve cycles during a call to LLVMDIBuilderFinalize. More...
 
unsigned LLVMGetModuleDebugMetadataVersion (LLVMModuleRef M)
 The version of debug metadata that's present in the provided Module. More...
 
LLVMBool LLVMStripModuleDebugInfo (LLVMModuleRef M)
 Strip debug info in the module if it exists. More...
 
void LLVMDisposeDIBuilder (LLVMDIBuilderRef Builder)
 Deallocates the DIBuilder and everything it owns. More...
 
void LLVMDIBuilderFinalize (LLVMDIBuilderRef Builder)
 Construct any deferred debug info descriptors. More...
 
void LLVMDIBuilderFinalizeSubprogram (LLVMDIBuilderRef Builder, LLVMMetadataRef subprogram)
 Finalize a specific subprogram. More...
 
LLVMMetadataRef LLVMDIBuilderCreateCompileUnit (LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang, LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen, LLVMBool isOptimized, const char *Flags, size_t FlagsLen, unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen, LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining, LLVMBool DebugInfoForProfiling, const char *SysRoot, size_t SysRootLen, const char *SDK, size_t SDKLen)
 A CompileUnit provides an anchor for all debugging information generated during this instance of compilation. More...
 
LLVMMetadataRef LLVMDIBuilderCreateFile (LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen, const char *Directory, size_t DirectoryLen)
 Create a file descriptor to hold debugging information for a file. More...
 
LLVMMetadataRef LLVMDIBuilderCreateModule (LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen, const char *IncludePath, size_t IncludePathLen, const char *APINotesFile, size_t APINotesFileLen)
 Creates a new descriptor for a module with the specified parent scope. More...
 
LLVMMetadataRef LLVMDIBuilderCreateNameSpace (LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, LLVMBool ExportSymbols)
 Creates a new descriptor for a namespace with the specified parent scope. More...
 
LLVMMetadataRef LLVMDIBuilderCreateFunction (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *LinkageName, size_t LinkageNameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool IsLocalToUnit, LLVMBool IsDefinition, unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized)
 Create a new descriptor for the specified subprogram. More...
 
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned Col)
 Create a descriptor for a lexical block with the specified parent context. More...
 
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Discriminator)
 Create a descriptor for a lexical block with a new file attached. More...
 
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, LLVMMetadataRef File, unsigned Line)
 Create a descriptor for an imported namespace. More...
 
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements)
 Create a descriptor for an imported module that aliases another imported entity descriptor. More...
 
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements)
 Create a descriptor for an imported module. More...
 
LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl, LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen, LLVMMetadataRef *Elements, unsigned NumElements)
 Create a descriptor for an imported function, type, or variable. More...
 
LLVMMetadataRef LLVMDIBuilderCreateDebugLocation (LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt)
 Creates a new DebugLocation that describes a source location. More...
 
unsigned LLVMDILocationGetLine (LLVMMetadataRef Location)
 Get the line number of this debug location. More...
 
unsigned LLVMDILocationGetColumn (LLVMMetadataRef Location)
 Get the column number of this debug location. More...
 
LLVMMetadataRef LLVMDILocationGetScope (LLVMMetadataRef Location)
 Get the local scope associated with this debug location. More...
 
LLVMMetadataRef LLVMDILocationGetInlinedAt (LLVMMetadataRef Location)
 Get the "inline at" location associated with this debug location. More...
 
LLVMMetadataRef LLVMDIScopeGetFile (LLVMMetadataRef Scope)
 Get the metadata of the file associated with a given scope. More...
 
const char * LLVMDIFileGetDirectory (LLVMMetadataRef File, unsigned *Len)
 Get the directory of a given file. More...
 
const char * LLVMDIFileGetFilename (LLVMMetadataRef File, unsigned *Len)
 Get the name of a given file. More...
 
const char * LLVMDIFileGetSource (LLVMMetadataRef File, unsigned *Len)
 Get the source of a given file. More...
 
LLVMMetadataRef LLVMDIBuilderCreateMacro (LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMDWARFMacinfoRecordType RecordType, const char *Name, size_t NameLen, const char *Value, size_t ValueLen)
 Create debugging information entry for a macro. More...
 
LLVMMetadataRef LLVMDIBuilderCreateTempMacroFile (LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMMetadataRef File)
 Create debugging information temporary entry for a macro file. More...
 
LLVMMetadataRef LLVMDIBuilderCreateEnumerator (LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value, LLVMBool IsUnsigned)
 Create debugging information entry for an enumerator. More...
 
LLVMMetadataRef LLVMDIBuilderCreateEnumerationType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef ClassTy)
 Create debugging information entry for an enumeration. More...
 
LLVMMetadataRef LLVMDIBuilderCreateUnionType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, const char *UniqueId, size_t UniqueIdLen)
 Create debugging information entry for a union. More...
 
LLVMMetadataRef LLVMDIBuilderCreateArrayType (LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
 Create debugging information entry for an array. More...
 
LLVMMetadataRef LLVMDIBuilderCreateVectorType (LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
 Create debugging information entry for a vector type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateBasicType (LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, LLVMDIFlags Flags)
 Create debugging information entry for a basic type. More...
 
LLVMMetadataRef LLVMDIBuilderCreatePointerType (LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace, const char *Name, size_t NameLen)
 Create debugging information entry for a pointer. More...
 
LLVMMetadataRef LLVMDIBuilderCreateStructType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder, const char *UniqueId, size_t UniqueIdLen)
 Create debugging information entry for a struct. More...
 
LLVMMetadataRef LLVMDIBuilderCreateMemberType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty)
 Create debugging information entry for a member. More...
 
LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType (LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
 Create a DWARF unspecified type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateStaticMemberType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal, uint32_t AlignInBits)
 Create debugging information entry for a C++ static data member. More...
 
LLVMMetadataRef LLVMDIBuilderCreateObjCIVar (LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode)
 Create debugging information entry for Objective-C instance variable. More...
 
LLVMMetadataRef LLVMDIBuilderCreateObjCProperty (LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, const char *GetterName, size_t GetterNameLen, const char *SetterName, size_t SetterNameLen, unsigned PropertyAttributes, LLVMMetadataRef Ty)
 Create debugging information entry for Objective-C property. More...
 
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType (LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
 Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set. More...
 
LLVMMetadataRef LLVMDIBuilderCreateTypedef (LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Scope, uint32_t AlignInBits)
 Create debugging information entry for a typedef. More...
 
LLVMMetadataRef LLVMDIBuilderCreateInheritance (LLVMDIBuilderRef Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, LLVMDIFlags Flags)
 Create debugging information entry to establish inheritance relationship between two types. More...
 
LLVMMetadataRef LLVMDIBuilderCreateForwardDecl (LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
 Create a permanent forward-declared type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType (LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
 Create a temporary forward-declared type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateQualifiedType (LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
 Create debugging information entry for a qualified type, e.g. More...
 
LLVMMetadataRef LLVMDIBuilderCreateReferenceType (LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
 Create debugging information entry for a c++ style reference or rvalue reference type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateNullPtrType (LLVMDIBuilderRef Builder)
 Create C++11 nullptr type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateMemberPointerType (LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType, LLVMMetadataRef ClassType, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags)
 Create debugging information entry for a pointer to member. More...
 
LLVMMetadataRef LLVMDIBuilderCreateBitFieldMemberType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Type)
 Create debugging information entry for a bit field member. More...
 
LLVMMetadataRef LLVMDIBuilderCreateClassType (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
 Create debugging information entry for a class. More...
 
LLVMMetadataRef LLVMDIBuilderCreateArtificialType (LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
 Create a uniqued DIType* clone with FlagArtificial set. More...
 
const char * LLVMDITypeGetName (LLVMMetadataRef DType, size_t *Length)
 Get the name of this DIType. More...
 
uint64_t LLVMDITypeGetSizeInBits (LLVMMetadataRef DType)
 Get the size of this DIType in bits. More...
 
uint64_t LLVMDITypeGetOffsetInBits (LLVMMetadataRef DType)
 Get the offset of this DIType in bits. More...
 
uint32_t LLVMDITypeGetAlignInBits (LLVMMetadataRef DType)
 Get the alignment of this DIType in bits. More...
 
unsigned LLVMDITypeGetLine (LLVMMetadataRef DType)
 Get the source line where this DIType is declared. More...
 
LLVMDIFlags LLVMDITypeGetFlags (LLVMMetadataRef DType)
 Get the flags associated with this DIType. More...
 
LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray (LLVMDIBuilderRef Builder, LLVMMetadataRef *Types, size_t Length)
 Create a type array. More...
 
LLVMMetadataRef LLVMDIBuilderCreateSubroutineType (LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
 Create subroutine type. More...
 
LLVMMetadataRef LLVMDIBuilderCreateExpression (LLVMDIBuilderRef Builder, uint64_t *Addr, size_t Length)
 Create a new descriptor for the specified variable which has a complex address expression for its address. More...
 
LLVMMetadataRef LLVMDIBuilderCreateConstantValueExpression (LLVMDIBuilderRef Builder, uint64_t Value)
 Create a new descriptor for the specified variable that does not have an address, but does have a constant value. More...
 
LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits)
 Create a new descriptor for the specified variable. More...
 
LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable (LLVMMetadataRef GVE)
 Retrieves the DIVariable associated with this global variable expression. More...
 
LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression (LLVMMetadataRef GVE)
 Retrieves the DIExpression associated with this global variable expression. More...
 
LLVMMetadataRef LLVMDIVariableGetFile (LLVMMetadataRef Var)
 Get the metadata of the file associated with a given variable. More...
 
LLVMMetadataRef LLVMDIVariableGetScope (LLVMMetadataRef Var)
 Get the metadata of the scope associated with a given variable. More...
 
unsigned LLVMDIVariableGetLine (LLVMMetadataRef Var)
 Get the source line where this DIVariable is declared. More...
 
LLVMMetadataRef LLVMTemporaryMDNode (LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t Count)
 Create a new temporary MDNode. More...
 
void LLVMDisposeTemporaryMDNode (LLVMMetadataRef TempNode)
 Deallocate a temporary node. More...
 
void LLVMMetadataReplaceAllUsesWith (LLVMMetadataRef TargetMetadata, LLVMMetadataRef Replacement)
 Replace all uses of temporary metadata. More...
 
LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Decl, uint32_t AlignInBits)
 Create a new descriptor for the specified global variable that is temporary and meant to be RAUWed. More...
 
LLVMValueRef LLVMDIBuilderInsertDeclareBefore (LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMValueRef Instr)
 Insert a new llvm.dbg.declare intrinsic call before the given instruction. More...
 
LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd (LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMBasicBlockRef Block)
 Insert a new llvm.dbg.declare intrinsic call at the end of the given basic block. More...
 
LLVMValueRef LLVMDIBuilderInsertDbgValueBefore (LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
 Insert a new llvm.dbg.value intrinsic call before the given instruction. More...
 
LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd (LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
 Insert a new llvm.dbg.value intrinsic call at the end of the given basic block. More...
 
LLVMMetadataRef LLVMDIBuilderCreateAutoVariable (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits)
 Create a new descriptor for a local auto variable. More...
 
LLVMMetadataRef LLVMDIBuilderCreateParameterVariable (LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags)
 Create a new descriptor for a function parameter variable. More...
 
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange (LLVMDIBuilderRef Builder, int64_t Lo, int64_t Count)
 Create a descriptor for a value range. More...
 
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray (LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t Length)
 Create an array of DI Nodes. More...
 
LLVMMetadataRef LLVMGetSubprogram (LLVMValueRef Func)
 Get the metadata of the subprogram attached to a function. More...
 
void LLVMSetSubprogram (LLVMValueRef Func, LLVMMetadataRef SP)
 Set the subprogram attached to a function. More...
 
unsigned LLVMDISubprogramGetLine (LLVMMetadataRef Subprogram)
 Get the line associated with a given subprogram. More...
 
LLVMMetadataRef LLVMInstructionGetDebugLoc (LLVMValueRef Inst)
 Get the debug location for the given instruction. More...
 
void LLVMInstructionSetDebugLoc (LLVMValueRef Inst, LLVMMetadataRef Loc)
 Set the debug location for the given instruction. More...
 
LLVMMetadataKind LLVMGetMetadataKind (LLVMMetadataRef Metadata)
 Obtain the enumerated type of a Metadata instance. More...
 

Macro Definition Documentation

◆ HANDLE_DW_LANG

#define HANDLE_DW_LANG (   ID,
  NAME,
  LOWER_BOUND,
  VERSION,
  VENDOR 
)
Value:
return ID;

◆ HANDLE_METADATA_LEAF

#define HANDLE_METADATA_LEAF (   CLASS)
Value:
case Metadata::CLASS##Kind: \
return (LLVMMetadataKind)LLVM##CLASS##MetadataKind;

Function Documentation

◆ isDILocationReachable()

static bool isDILocationReachable ( SmallPtrSetImpl< Metadata * > &  Visited,
SmallPtrSetImpl< Metadata * > &  Reachable,
Metadata MD 
)
static

Return true if a node is a DILocation or if a DILocation is indirectly referenced by one of the node's children.

Definition at line 384 of file DebugInfo.cpp.

References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallPtrSetImpl< PtrType >::insert(), and N.

◆ map_from_llvmDIFlags()

static DINode::DIFlags map_from_llvmDIFlags ( LLVMDIFlags  Flags)
static

◆ map_from_llvmDWARFsourcelanguage()

static unsigned map_from_llvmDWARFsourcelanguage ( LLVMDWARFSourceLanguage  lang)
static

Definition at line 854 of file DebugInfo.cpp.

References llvm_unreachable.

Referenced by LLVMDIBuilderCreateCompileUnit().

◆ map_to_llvmDIFlags()

static LLVMDIFlags map_to_llvmDIFlags ( DINode::DIFlags  Flags)
static

Definition at line 873 of file DebugInfo.cpp.

Referenced by LLVMDITypeGetFlags().

◆ pack_into_DISPFlags()

static DISubprogram::DISPFlags pack_into_DISPFlags ( bool  IsLocalToUnit,
bool  IsDefinition,
bool  IsOptimized 
)
static

Definition at line 878 of file DebugInfo.cpp.

References llvm::DISubprogram::toSPFlags().

Referenced by LLVMDIBuilderCreateFunction().

◆ stripDebugLocFromLoopID()

static MDNode* stripDebugLocFromLoopID ( MDNode N)
static

◆ unwrapDI()

template<typename DIT >
DIT* unwrapDI ( LLVMMetadataRef  Ref)

Definition at line 865 of file DebugInfo.cpp.

References llvm::Ref.

◆ updateLoopMetadataDebugLocationsImpl()

static MDNode* updateLoopMetadataDebugLocationsImpl ( MDNode OrigLoopID,
function_ref< Metadata *(Metadata *)>  Updater 
)
static
LLVMDWARFSourceLanguage
LLVMDWARFSourceLanguage
Source languages known by DWARF.
Definition: DebugInfo.h:78
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
LLVMMetadataKind
unsigned LLVMMetadataKind
Definition: DebugInfo.h:174
LLVM
MIPS Relocation Principles In LLVM
Definition: Relocation.txt:3
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38