LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::DIDescriptor Class Reference

#include <DebugInfo.h>

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

Public Types

enum  {
  FlagPrivate = 1 << 0, FlagProtected = 1 << 1, 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
}
 

Public Member Functions

 DIDescriptor (const MDNode *N=0)
 
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. More...
 
bool isCompositeType () const
 
bool isBasicType () const
 
bool isVariable () const
 isVariable - Return true if the specified tag is legal for DIVariable. More...
 
bool isSubprogram () const
 
bool isGlobalVariable () const
 
bool isScope () const
 
bool isFile () const
 isFile - Return true if the specified tag is DW_TAG_file_type. More...
 
bool isCompileUnit () const
 isCompileUnit - Return true if the specified tag is DW_TAG_compile_unit. More...
 
bool isNameSpace () const
 isNameSpace - Return true if the specified tag is DW_TAG_namespace. More...
 
bool isLexicalBlockFile () const
 
bool isLexicalBlock () const
 isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block. More...
 
bool isSubrange () const
 isSubrange - Return true if the specified tag is DW_TAG_subrange_type. More...
 
bool isEnumerator () const
 isEnumerator - Return true if the specified tag is DW_TAG_enumerator. More...
 
bool isType () const
 isType - Return true if the specified tag is legal for DIType. More...
 
bool isUnspecifiedParameter () const
 
bool isTemplateTypeParameter () const
 
bool isTemplateValueParameter () const
 
bool isObjCProperty () const
 isObjCProperty - Return true if the specified tag is DW_TAG_APPLE_property. More...
 
bool isImportedEntity () const
 Return true if the specified tag is DW_TAG_imported_module or DW_TAG_imported_declaration. More...
 
void print (raw_ostream &OS) const
 print - print descriptor. More...
 
void dump () const
 dump - print descriptor to dbgs() with a newline. More...
 

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
 
GlobalVariablegetGlobalVariableField (unsigned Elt) const
 
ConstantgetConstantField (unsigned Elt) const
 
FunctiongetFunctionField (unsigned Elt) const
 
void replaceFunctionField (unsigned Elt, Function *F)
 
template<>
DIScopeRef getFieldAs (unsigned Elt) const
 Specialize getFieldAs to handle fields that are references to DIScopes. More...
 
template<>
DITypeRef getFieldAs (unsigned Elt) const
 Specialize getFieldAs to handle fields that are references to DITypes. More...
 
template<>
DIScopeRef getFieldAs (unsigned Elt) const
 Specialize getFieldAs to handle fields that are references to DIScopes. More...
 
template<>
DITypeRef getFieldAs (unsigned Elt) const
 Specialize getFieldAs to handle fields that are references to DITypes. More...
 

Protected Attributes

const MDNodeDbgNode
 

Friends

template<typename T >
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 60 of file DebugInfo.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FlagPrivate 
FlagProtected 
FlagFwdDecl 
FlagAppleBlock 
FlagBlockByrefStruct 
FlagVirtual 
FlagArtificial 
FlagExplicit 
FlagPrototyped 
FlagObjcClassComplete 
FlagObjectPointer 
FlagVector 
FlagStaticMember 
FlagIndirectVariable 

Definition at line 66 of file DebugInfo.h.

Constructor & Destructor Documentation

llvm::DIDescriptor::DIDescriptor ( const MDNode N = 0)
inlineexplicit

Definition at line 104 of file DebugInfo.h.

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 1195 of file DebugInfo.cpp.

References llvm::dbgs().

Constant * DIDescriptor::getConstantField ( unsigned  Elt) const
protected
DIDescriptor DIDescriptor::getDescriptorField ( unsigned  Elt) const
protected

Definition at line 97 of file DebugInfo.cpp.

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

Referenced by llvm::DIArray::getElement(), and getFieldAs().

template<typename DescTy >
DescTy llvm::DIDescriptor::getFieldAs ( unsigned  Elt) const
inlineprotected

Definition at line 94 of file DebugInfo.h.

References getDescriptorField().

template<>
DIScopeRef llvm::DIDescriptor::getFieldAs ( unsigned  Elt) const
protected

Specialize getFieldAs to handle fields that are references to DIScopes.

template<>
DITypeRef llvm::DIDescriptor::getFieldAs ( unsigned  Elt) const
protected

Specialize getFieldAs to handle fields that are references to DITypes.

template<>
DIScopeRef llvm::DIDescriptor::getFieldAs ( unsigned  Elt) const
protected

Specialize getFieldAs to handle fields that are references to DIScopes.

Definition at line 1422 of file DebugInfo.cpp.

References getField().

template<>
DITypeRef llvm::DIDescriptor::getFieldAs ( unsigned  Elt) const
protected

Specialize getFieldAs to handle fields that are references to DITypes.

Definition at line 1426 of file DebugInfo.cpp.

References getField().

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

Definition at line 120 of file DebugInfo.cpp.

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

GlobalVariable * DIDescriptor::getGlobalVariableField ( unsigned  Elt) const
protected

Definition at line 102 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
inlineprotected

Definition at line 87 of file DebugInfo.h.

References getUInt64Field().

Referenced by llvm::DIVariable::getArgNumber(), llvm::DILexicalBlock::getColumnNumber(), llvm::DITemplateTypeParameter::getColumnNumber(), llvm::DITemplateValueParameter::getColumnNumber(), llvm::DILocation::getColumnNumber(), 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::DIObjCProperty::isNonAtomicObjCProperty(), llvm::DIVariable::isObjectPointer(), llvm::DICompileUnit::isOptimized(), llvm::DISubprogram::isPrivate(), llvm::DISubprogram::isProtected(), llvm::DISubprogram::isPrototyped(), llvm::DIObjCProperty::isReadOnlyObjCProperty(), llvm::DIObjCProperty::isReadWriteObjCProperty(), and llvm::DIObjCProperty::isRetainObjCProperty().

bool DIDescriptor::isBasicType ( ) const

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

Definition at line 152 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::getOrCreateTypeDIE(), isTypeSigned(), and isUnsignedDIType().

bool DIDescriptor::isCompileUnit ( ) const

isCompileUnit - Return true if the specified tag is DW_TAG_compile_unit.

Definition at line 275 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::addGlobalType(), llvm::CompileUnit::createGlobalVariableDIE(), and llvm::CompileUnit::getParentContextString().

bool DIDescriptor::isCompositeType ( ) const
bool DIDescriptor::isDerivedType ( ) const

isDerivedType - Return true if the specified tag is legal for DIDerivedType.

Definition at line 165 of file DebugInfo.cpp.

Referenced by getBaseTypeSize(), llvm::getDICompositeType(), llvm::CompileUnit::getOrCreateTypeDIE(), isTypeSigned(), and isUnsignedDIType().

bool DIDescriptor::isEnumerator ( ) const

isEnumerator - Return true if the specified tag is DW_TAG_enumerator.

Definition at line 308 of file DebugInfo.cpp.

bool DIDescriptor::isFile ( ) const

isFile - Return true if the specified tag is DW_TAG_file_type.

Definition at line 280 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::addGlobalType(), llvm::CompileUnit::createGlobalVariableDIE(), and llvm::CompileUnit::getOrCreateContextDIE().

bool DIDescriptor::isGlobalVariable ( ) const

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

Definition at line 231 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::addSourceLine(), and llvm::CompileUnit::createGlobalVariableDIE().

bool DIDescriptor::isImportedEntity ( ) const

Return true if the specified tag is DW_TAG_imported_module or DW_TAG_imported_declaration.

Definition at line 319 of file DebugInfo.cpp.

bool DIDescriptor::isLexicalBlock ( ) const

isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.

Definition at line 297 of file DebugInfo.cpp.

Referenced by llvm::getDISubprogram().

bool DIDescriptor::isLexicalBlockFile ( ) const

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

Definition at line 291 of file DebugInfo.cpp.

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

bool DIDescriptor::isNameSpace ( ) const

isNameSpace - Return true if the specified tag is DW_TAG_namespace.

Definition at line 285 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::addGlobalType(), and llvm::CompileUnit::getOrCreateContextDIE().

bool DIDescriptor::isObjCProperty ( ) const

isObjCProperty - Return true if the specified tag is DW_TAG_APPLE_property.

Definition at line 313 of file DebugInfo.cpp.

Referenced by llvm::CompileUnit::addSourceLine().

bool DIDescriptor::isScope ( ) const

isScope - Return true if the specified tag is one of the scope related tag.

Definition at line 244 of file DebugInfo.cpp.

References llvm::dwarf::isType().

Referenced by llvm::DIBuilder::createClassType(), llvm::DIBuilder::createLocalVariable(), isScopeRef(), and printDebugLoc().

bool DIDescriptor::isSubprogram ( ) const
bool DIDescriptor::isSubrange ( ) const

isSubrange - Return true if the specified tag is DW_TAG_subrange_type.

Definition at line 303 of file DebugInfo.cpp.

bool DIDescriptor::isTemplateTypeParameter ( ) const

isTemplateTypeParameter - Return true if the specified tag is DW_TAG_template_type_parameter.

Definition at line 262 of file DebugInfo.cpp.

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

bool DIDescriptor::isTemplateValueParameter ( ) const

isTemplateValueParameter - Return true if the specified tag is DW_TAG_template_value_parameter.

Definition at line 268 of file DebugInfo.cpp.

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

bool DIDescriptor::isType ( ) const
bool DIDescriptor::isUnspecifiedParameter ( ) const

isUnspecifiedParmeter - Return true if the specified tag is DW_TAG_unspecified_parameters.

Definition at line 238 of file DebugInfo.cpp.

bool DIDescriptor::isVariable ( ) const
LLVM_EXPLICIT llvm::DIDescriptor::operator bool ( ) const
inline

Definition at line 116 of file DebugInfo.h.

References DbgNode.

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

Definition at line 108 of file DebugInfo.h.

References DbgNode.

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

Definition at line 119 of file DebugInfo.h.

References operator==().

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

Definition at line 109 of file DebugInfo.h.

References DbgNode.

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

Definition at line 118 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 1201 of file DebugInfo.cpp.

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

Referenced by llvm::WriteMDNodeComment().

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

Definition at line 129 of file DebugInfo.cpp.

References llvm::MDNode::replaceOperandWith().

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

bool DIDescriptor::Verify ( ) const

Friends And Related Function Documentation

template<typename T >
friend class DIRef
friend

Definition at line 63 of file DebugInfo.h.

Member Data Documentation

const MDNode* llvm::DIDescriptor::DbgNode
protected

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