LLVM API Documentation

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
llvm::DIDescriptor Class Reference

#include <DebugInfo.h>

Inheritance diagram for llvm::DIDescriptor:
Inheritance graph
[legend]
Collaboration diagram for llvm::DIDescriptor:
Collaboration graph
[legend]

List of all members.

Public Types

enum  {
  FlagAccessibility = 1 << 0 | 1 << 1, FlagPrivate = 1, FlagProtected = 2, FlagPublic = 3,
  FlagFwdDecl = 1 << 2, FlagAppleBlock = 1 << 3, FlagBlockByrefStruct = 1 << 4, FlagVirtual = 1 << 5,
  FlagArtificial = 1 << 6, FlagExplicit = 1 << 7, FlagPrototyped = 1 << 8, FlagObjcClassComplete = 1 << 9,
  FlagObjectPointer = 1 << 10, FlagVector = 1 << 11, FlagStaticMember = 1 << 12, FlagIndirectVariable = 1 << 13,
  FlagLValueReference = 1 << 14, FlagRValueReference = 1 << 15
}

Public Member Functions

 DIDescriptor (const MDNode *N=nullptr)
bool Verify () const
 operator MDNode * () const
MDNodeoperator-> () const
LLVM_EXPLICIT operator bool () const
bool operator== (DIDescriptor Other) const
bool operator!= (DIDescriptor Other) const
uint16_t getTag () const
bool isDerivedType () const
 isDerivedType - Return true if the specified tag is legal for DIDerivedType.
bool isCompositeType () const
bool isSubroutineType () const
bool isBasicType () const
bool isVariable () const
 isVariable - Return true if the specified tag is legal for DIVariable.
bool isSubprogram () const
bool isGlobalVariable () const
bool isScope () const
bool isFile () const
 isFile - Return true if the specified tag is DW_TAG_file_type.
bool isCompileUnit () const
 isCompileUnit - Return true if the specified tag is DW_TAG_compile_unit.
bool isNameSpace () const
 isNameSpace - Return true if the specified tag is DW_TAG_namespace.
bool isLexicalBlockFile () const
bool isLexicalBlock () const
 isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.
bool isSubrange () const
 isSubrange - Return true if the specified tag is DW_TAG_subrange_type.
bool isEnumerator () const
 isEnumerator - Return true if the specified tag is DW_TAG_enumerator.
bool isType () const
 isType - Return true if the specified tag is legal for DIType.
bool isTemplateTypeParameter () const
bool isTemplateValueParameter () const
bool isObjCProperty () const
 isObjCProperty - Return true if the specified tag is DW_TAG_APPLE_property.
bool isImportedEntity () const
 Return true if the specified tag is DW_TAG_imported_module or DW_TAG_imported_declaration.
void print (raw_ostream &OS) const
 print - print descriptor.
void dump () const
 dump - print descriptor to dbgs() with a newline.
void replaceAllUsesWith (LLVMContext &VMContext, DIDescriptor D)
void replaceAllUsesWith (MDNode *D)

Protected Member Functions

StringRef getStringField (unsigned Elt) const
unsigned getUnsignedField (unsigned Elt) const
uint64_t getUInt64Field (unsigned Elt) const
int64_t getInt64Field (unsigned Elt) const
DIDescriptor getDescriptorField (unsigned Elt) const
template<typename DescTy >
DescTy getFieldAs (unsigned Elt) const
 Specialize getFieldAs to handle fields that are references to DIScopes.
GlobalVariablegetGlobalVariableField (unsigned Elt) const
ConstantgetConstantField (unsigned Elt) const
FunctiongetFunctionField (unsigned Elt) const
void replaceFunctionField (unsigned Elt, Function *F)

Protected Attributes

const MDNodeDbgNode

Friends

class DIRef

Detailed Description

DIDescriptor - A thin wraper around MDNode to access encoded debug info. This should not be stored in a container, because the underlying MDNode may change in certain situations.

Definition at line 61 of file DebugInfo.h.


Member Enumeration Documentation

anonymous enum

The three accessibility flags are mutually exclusive and rolled together in the first two bits.

Enumerator:
FlagAccessibility 
FlagPrivate 
FlagProtected 
FlagPublic 
FlagFwdDecl 
FlagAppleBlock 
FlagBlockByrefStruct 
FlagVirtual 
FlagArtificial 
FlagExplicit 
FlagPrototyped 
FlagObjcClassComplete 
FlagObjectPointer 
FlagVector 
FlagStaticMember 
FlagIndirectVariable 
FlagLValueReference 
FlagRValueReference 

Definition at line 69 of file DebugInfo.h.


Constructor & Destructor Documentation

llvm::DIDescriptor::DIDescriptor ( const MDNode N = nullptr) [inline, explicit]

Definition at line 112 of file DebugInfo.h.

References N.


Member Function Documentation

void DIDescriptor::dump ( ) const

dump - print descriptor to dbgs() with a newline.

dump - Print descriptor to dbgs() with a newline.

Definition at line 1257 of file DebugInfo.cpp.

References llvm::dbgs().

Constant * DIDescriptor::getConstantField ( unsigned  Elt) const [protected]

Definition at line 99 of file DebugInfo.cpp.

References llvm::tgtok::Field, and getNodeField().

Referenced by getFieldAs(), and llvm::DIVariable::getNumAddrElements().

DITypeRef DIDescriptor::getFieldAs< DITypeRef > ( unsigned  Elt) const [inline, protected]

Specialize getFieldAs to handle fields that are references to DIScopes.

Specialize getFieldAs to handle fields that are references to DITypes.

Definition at line 102 of file DebugInfo.h.

References getDescriptorField().

Function * DIDescriptor::getFunctionField ( unsigned  Elt) const [protected]

Definition at line 122 of file DebugInfo.cpp.

Referenced by llvm::DISubprogram::getFunction().

Definition at line 104 of file DebugInfo.cpp.

Referenced by llvm::DIGlobalVariable::getGlobal().

int64_t DIDescriptor::getInt64Field ( unsigned  Elt) const [protected]
StringRef DIDescriptor::getStringField ( unsigned  Elt) const [protected]
uint16_t llvm::DIDescriptor::getTag ( ) const [inline]
uint64_t DIDescriptor::getUInt64Field ( unsigned  Elt) const [protected]
unsigned llvm::DIDescriptor::getUnsignedField ( unsigned  Elt) const [inline, protected]

Definition at line 95 of file DebugInfo.h.

References getUInt64Field().

Referenced by llvm::DIVariable::getArgNumber(), llvm::DILexicalBlock::getColumnNumber(), llvm::DITemplateTypeParameter::getColumnNumber(), llvm::DITemplateValueParameter::getColumnNumber(), llvm::DILocation::getColumnNumber(), llvm::DILexicalBlockFile::getDiscriminator(), llvm::DICompileUnit::getEmissionKind(), llvm::DIBasicType::getEncoding(), llvm::DIType::getFlags(), llvm::DISubprogram::getFlags(), llvm::DICompileUnit::getLanguage(), llvm::DIType::getLineNumber(), llvm::DISubprogram::getLineNumber(), llvm::DILexicalBlock::getLineNumber(), llvm::DINameSpace::getLineNumber(), llvm::DITemplateTypeParameter::getLineNumber(), llvm::DITemplateValueParameter::getLineNumber(), llvm::DIGlobalVariable::getLineNumber(), llvm::DIVariable::getLineNumber(), llvm::DILocation::getLineNumber(), llvm::DIObjCProperty::getLineNumber(), llvm::DIImportedEntity::getLineNumber(), llvm::DICompositeType::getRunTimeLang(), llvm::DICompileUnit::getRunTimeVersion(), llvm::DISubprogram::getScopeLineNumber(), getTag(), llvm::DISubprogram::getVirtualIndex(), llvm::DISubprogram::getVirtuality(), llvm::DISubprogram::isArtificial(), llvm::DIVariable::isArtificial(), llvm::DIObjCProperty::isAssignObjCProperty(), llvm::DIObjCProperty::isCopyObjCProperty(), llvm::DISubprogram::isDefinition(), llvm::DIGlobalVariable::isDefinition(), llvm::DISubprogram::isExplicit(), llvm::DIVariable::isIndirect(), llvm::DISubprogram::isLocalToUnit(), llvm::DIGlobalVariable::isLocalToUnit(), llvm::DISubprogram::isLValueReference(), llvm::DIObjCProperty::isNonAtomicObjCProperty(), llvm::DIVariable::isObjectPointer(), llvm::DICompileUnit::isOptimized(), llvm::DISubprogram::isPrototyped(), llvm::DIObjCProperty::isReadOnlyObjCProperty(), llvm::DIObjCProperty::isReadWriteObjCProperty(), llvm::DIObjCProperty::isRetainObjCProperty(), and llvm::DISubprogram::isRValueReference().

isBasicType - Return true if the specified tag is legal for DIBasicType.

Definition at line 194 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_base_type, and llvm::dwarf::DW_TAG_unspecified_type.

Referenced by llvm::DwarfUnit::getOrCreateTypeDIE(), and isUnsignedDIType().

isCompileUnit - Return true if the specified tag is DW_TAG_compile_unit.

Definition at line 311 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_compile_unit.

Referenced by llvm::DwarfUnit::getParentContextString().

isEnumerator - Return true if the specified tag is DW_TAG_enumerator.

Definition at line 344 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_enumerator.

isFile - Return true if the specified tag is DW_TAG_file_type.

Definition at line 316 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_file_type.

Referenced by llvm::DwarfUnit::getOrCreateContextDIE().

isGlobalVariable - Return true if the specified tag is legal for DIGlobalVariable.

Definition at line 273 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_constant, and llvm::dwarf::DW_TAG_variable.

Referenced by llvm::DwarfUnit::addSourceLine(), and llvm::DwarfCompileUnit::createGlobalVariableDIE().

Return true if the specified tag is DW_TAG_imported_module or DW_TAG_imported_declaration.

Definition at line 355 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_imported_declaration, and llvm::dwarf::DW_TAG_imported_module.

isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.

Definition at line 333 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_lexical_block.

Referenced by llvm::getDISubprogram(), and llvm::LexicalScopes::getOrCreateAbstractScope().

isLexicalBlockFile - Return true if the specified descriptor is a lexical block with an extra file.

Definition at line 327 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_lexical_block.

Referenced by llvm::LexicalScopes::findLexicalScope(), llvm::DILocation::getDiscriminator(), llvm::getDISubprogram(), and llvm::LexicalScopes::getOrCreateAbstractScope().

isNameSpace - Return true if the specified tag is DW_TAG_namespace.

Definition at line 321 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_namespace.

Referenced by llvm::DwarfUnit::getOrCreateContextDIE(), and llvm::DwarfUnit::getParentContextString().

isObjCProperty - Return true if the specified tag is DW_TAG_APPLE_property.

Definition at line 349 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_APPLE_property.

Referenced by llvm::DwarfUnit::addSourceLine(), and llvm::DwarfUnit::constructTypeDIE().

isSubrange - Return true if the specified tag is DW_TAG_subrange_type.

Definition at line 339 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_subrange_type.

Definition at line 188 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_subroutine_type.

Referenced by llvm::DICompositeType::getElements().

isTemplateTypeParameter - Return true if the specified tag is DW_TAG_template_type_parameter.

Definition at line 298 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_template_type_parameter.

Referenced by llvm::DwarfUnit::addTemplateParams().

isTemplateValueParameter - Return true if the specified tag is DW_TAG_template_value_parameter.

Definition at line 304 of file DebugInfo.cpp.

References llvm::dwarf::DW_TAG_GNU_template_parameter_pack, llvm::dwarf::DW_TAG_GNU_template_template_param, and llvm::dwarf::DW_TAG_template_value_parameter.

Referenced by llvm::DwarfUnit::addTemplateParams().

LLVM_EXPLICIT llvm::DIDescriptor::operator bool ( ) const [inline]

Definition at line 124 of file DebugInfo.h.

References DbgNode.

llvm::DIDescriptor::operator MDNode * ( ) const [inline]

Definition at line 116 of file DebugInfo.h.

References DbgNode.

bool llvm::DIDescriptor::operator!= ( DIDescriptor  Other) const [inline]

Definition at line 127 of file DebugInfo.h.

References operator==().

MDNode* llvm::DIDescriptor::operator-> ( ) const [inline]

Definition at line 117 of file DebugInfo.h.

References DbgNode.

bool llvm::DIDescriptor::operator== ( DIDescriptor  Other) const [inline]

Definition at line 126 of file DebugInfo.h.

References DbgNode.

Referenced by operator!=().

void DIDescriptor::print ( raw_ostream OS) const

print - print descriptor.

print - Print descriptor.

Definition at line 1263 of file DebugInfo.cpp.

References llvm::DIScope::printInternal(), llvm::DIType::printInternal(), and llvm::dwarf::TagString().

Referenced by llvm::WriteMDNodeComment().

replaceAllUsesWith - Replace all uses of debug info referenced by this descriptor.

replaceAllUsesWith - Replace all uses of the MDNode used by this type with the one in the passed descriptor.

Definition at line 366 of file DebugInfo.cpp.

References llvm::MDNode::deleteTemporary(), llvm::MDNode::get(), Node, and llvm::Value::replaceAllUsesWith().

Referenced by llvm::DIBuilder::finalize().

replaceAllUsesWith - Replace all uses of the MDNode used by this type with the one in D.

Definition at line 392 of file DebugInfo.cpp.

References llvm::MDNode::deleteTemporary(), Node, and llvm::Value::replaceAllUsesWith().

void DIDescriptor::replaceFunctionField ( unsigned  Elt,
Function F 
) [protected]

Definition at line 131 of file DebugInfo.cpp.

References Node, and llvm::MDNode::replaceOperandWith().

Referenced by llvm::DISubprogram::replaceFunction().


Friends And Related Function Documentation

friend class DIRef [friend]

Definition at line 64 of file DebugInfo.h.


Member Data Documentation


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