17 #ifndef LLVM_DEBUGINFO_H
18 #define LLVM_DEBUGINFO_H
48 class DILexicalBlockFile;
63 template <
typename T>
friend class DIRef;
94 template <
typename DescTy> DescTy
getFieldAs(
unsigned Elt)
const {
220 template <
typename T>
class DIRef {
221 template <
typename DescTy>
229 explicit DIRef(
const Value *V);
234 operator Value *()
const {
return const_cast<Value *
>(Val); }
237 template <
typename T>
242 if (
const MDNode *MD = dyn_cast<MDNode>(Val))
245 const MDString *MS = cast<MDString>(Val);
248 assert(Iter != Map.
end() &&
"Identifier not in the type map?");
250 "MDNode in DITypeIdentifierMap should be a DIType.");
251 return T(Iter->second);
258 if (
const MDNode *MD = dyn_cast<MDNode>(Val))
259 return T(MD).getName();
261 const MDString *MS = cast<MDString>(Val);
266 template <>
DIScopeRef DIDescriptor::getFieldAs<DIScopeRef>(
unsigned Elt)
const;
271 template <>
DITypeRef DIDescriptor::getFieldAs<DITypeRef>(
unsigned Elt)
const;
352 assert(
getTag() == dwarf::DW_TAG_ptr_to_member_type);
353 return getFieldAs<DITypeRef>(10);
486 return getFieldAs<DISubprogram>(17);
596 return getFieldAs<DIDerivedType>(12);
748 LLVMContext &VMContext);
782 void InitializeTypeMap(
const Module &M);
785 void processType(
DIType DT);
793 void processScope(
DIScope Scope);
837 bool TypeMapInitialized;
bool isBlockByrefVariable() const
unsigned isLocalToUnit() const
StringRef getName() const
iterator subprogram_begin() const
unsigned isLocalToUnit() const
bool Verify() const
Verify that the file descriptor is well formed.
COFF::RelocationTypeX86 Type
DITemplateTypeParameter - This is a wrapper for template type parameter.
bool Verify() const
Verify - Verify that a composite type descriptor is well formed.
DICompositeType getDICompositeType(DIType T)
getDICompositeType - Find underlying composite type.
StringRef getString() const
GlobalVariable * getGlobal() const
void printInternal(raw_ostream &OS) const
DILocation getOrigLocation() const
bool isArtificial() const
DIGlobalVariable(const MDNode *N=0)
Constant * getConstantField(unsigned Elt) const
DINameSpace(const MDNode *N=0)
bool isNonAtomicObjCProperty() const
DIImportedEntity(const MDNode *N)
DescTy getFieldAs(unsigned Elt) const
StringRef getDirectory() const
bool isVariable() const
isVariable - Return true if the specified tag is legal for DIVariable.
void replaceAllUsesWith(DIDescriptor &D)
bool isSubprogram() const
The main container class for the LLVM Intermediate Representation.
DIEnumerator(const MDNode *N=0)
StringRef getFlags() const
bool operator==(DIDescriptor Other) const
DIScopeRef getContext() const
unsigned getLineNumber() const
unsigned global_variable_count() const
unsigned getLineNumber() const
bool Verify() const
Verify that the imported module descriptor is well formed.
DILocation(const MDNode *N)
bool Verify() const
Verify that the template type parameter descriptor is well formed.
DITypeRef getType() const
uint64_t getAlignInBits() const
unsigned isDefinition() const
iterator type_begin() const
uint64_t getUInt64Field(unsigned Elt) const
MDNode * getInlinedAt() const
getInlinedAt - If this variable is inlined then return inline location.
DIScope getContext() const
bool isUnspecifiedParameter() const
void reset()
Clear all lists.
DIArray getTemplateParams() const
MDNode * getObjCProperty() const
getObjCProperty - Return property node, if this ivar is associated with one.
StringRef getObjCPropertyGetterName() const
MDNode - a tuple of other values.
unsigned getRunTimeLang() const
unsigned scope_count() const
DIScope getContext() const
bool isObjectPointer() const
DIScope getContext() const
DIFile(const MDNode *N=0)
DICompositeType getType() const
bool isObjCProperty() const
isObjCProperty - Return true if the specified tag is DW_TAG_APPLE_property.
StringRef getObjCPropertyName() const
Constant * getConstant() const
void processModule(const Module &M)
processModule - Process entire module and collect debug info.
MDNode * operator->() const
SmallVectorImpl< MDNode * >::const_iterator iterator
unsigned getLineNumber() const
iterator compile_unit_begin() const
DITemplateTypeParameter(const MDNode *N=0)
DIArray - This descriptor holds an array of descriptors.
bool Verify() const
Verify - Verify that a compile unit is well formed.
unsigned isArtificial() const
void setTypeArray(DIArray Elements, DIArray TParams=DIArray())
Set the array of member DITypes.
DIScopeRef getContext() const
uint64_t getAddrElement(unsigned Idx) const
DIScope(const MDNode *N=0)
unsigned getNumAddrElements() const
DIScope getContext() const
bool Verify() const
Verify that the lexical block descriptor is well formed.
StringRef getObjCPropertySetterName() const
DISubrange - This is used to represent ranges, for array bounds.
StringRef getDirectory() const
StringRef getName() const
bool Verify() const
Verify - Verify that a location descriptor is well formed.
void addMember(DIDescriptor D)
StringRef getFilename() const
DIBasicType(const MDNode *N=0)
bool Verify() const
Verify - Verify that a global variable descriptor is well formed.
bool isIndirect() const
Return true if this variable is represented as a pointer.
DIScopeRef getRef() const
bool isAppleBlockExtension() const
DIDescriptor(const MDNode *N=0)
StringRef getName() const
DIScopeRef getContext() const
unsigned getColumnNumber() const
iterator scope_begin() const
bool Verify() const
Verify - Verify that a derived type descriptor is well formed.
DIDescriptor getEntity() const
DISubprogram - This is a wrapper for a subprogram (e.g. a function).
DIArray getEnumTypes() const
StringRef getDirectory() const
bool operator!=(DIDescriptor Other) const
bool isPrototyped() const
isPrototyped - Return true if this subprogram is prototyped.
void setContainingType(DICompositeType ContainingType)
Set the containing type.
unsigned getLineNumber() const
unsigned subprogram_count() const
bool isArtificial() const
isArtificial - Return true if this variable is marked as "artificial".
bool hasComplexAddress() const
HasComplexAddr - Return true if the variable has a complex address.
bool isRetainObjCProperty() const
StringRef getName() const
unsigned getLineNumber() const
unsigned isOptimized() const
DIFile - This is a wrapper for a file.
DIScopeRef getContext() const
bool isTemplateTypeParameter() const
DILexicalBlock(const MDNode *N=0)
DISubrange(const MDNode *N=0)
bool isType() const
isType - Return true if the specified tag is legal for DIType.
StringRef getName() const
DILexicalBlock - This is a wrapper for a lexical block.
DISubprogram getDISubprogram(const MDNode *Scope)
getDISubprogram - Find subprogram that is enclosing this scope.
bool Verify() const
Verify - Verify that a variable descriptor is well formed.
Function * getFunction() const
unsigned isDefinition() const
DITemplateValueParameter(const MDNode *N=0)
bool isReadOnlyObjCProperty() const
DITypeRef getContainingType() const
DITemplateValueParameter - This is a wrapper for template value parameter.
DIArray getRetainedTypes() const
DITypeRef getContainingType() const
bool isTemplateValueParameter() const
StringRef getFilename() const
StringRef getName() const
If the scope node has a name, return that, else return an empty string.
MDNode * getVariablesNodes() const
MDString * getIdentifier() const
unsigned getLineNumber() const
DIDescriptor getElement(unsigned Idx) const
DIArray getGlobalVariables() const
bool describes(const Function *F)
LLVM Constant Representation.
DIVariable cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext)
cleanseInlinedVariable - Remove inlined scope from the variable.
void replaceFunctionField(unsigned Elt, Function *F)
bool isInlinedFnArgument(const Function *CurFn)
DILexicalBlock getScope() const
StringRef getFilename() const
iterator subprogram_end() const
void printInternal(raw_ostream &OS) const
DIGlobalVariable - This is a wrapper for a global variable.
StringRef getLinkageName() const
unsigned getLineNumber() const
DIScopeRef getContext() const
unsigned getEncoding() const
bool Verify() const
Verify that the file-scoped lexical block descriptor is well formed.
void processValue(const Module &M, const DbgValueInst *DVI)
Process DbgValueInst.
uint64_t getOffsetInBits() const
StringRef getDirectory() const
unsigned getNumElements() const
bool isObjectPointer() const
unsigned compile_unit_count() const
iterator global_variable_begin() const
bool isImportedEntity() const
Return true if the specified tag is DW_TAG_imported_module or DW_TAG_imported_declaration.
DIArray getTemplateParams() const
bool Verify() const
Verify that the subrange descriptor is well formed.
unsigned getLineNumber() const
bool Verify() const
Verify that the enumerator descriptor is well formed.
An imported module (C++ using directive or similar).
DIScope - A base class for various scopes.
DISubprogram(const MDNode *N=0)
StringRef getName() const
StringRef getDisplayName() const
int64_t getEnumValue() const
T resolve(const DITypeIdentifierMap &Map) const
void processLocation(const Module &M, DILocation Loc)
processLocation - Process DILocation.
DIDescriptor getDescriptorField(unsigned Elt) const
unsigned getLineNumber() const
unsigned getLineNumber() const
bool Verify() const
Verify - Verify that a derived type descriptor is well formed.
iterator type_end() const
DINameSpace - A wrapper for a C++ style name space.
StringRef getName() const
unsigned getColumnNumber() const
DICompileUnit(const MDNode *N=0)
int64_t getInt64Field(unsigned Elt) const
bool isLexicalBlockFile() const
bool isGlobalVariable() const
bool isAssignObjCProperty() const
NamedMDNode * getOrInsertFnSpecificMDNode(Module &M, DISubprogram SP)
StringRef getName() const
unsigned getUnsignedField(unsigned Elt) const
DIArray getTypeArray() const
iterator compile_unit_end() const
unsigned getColumnNumber() const
DIDerivedType getStaticDataMemberDeclaration() const
DIType(const MDNode *N=0)
DISubprogram getFunctionDeclaration() const
bool isBlockByrefStruct() const
DIScope getContext() const
StringRef getStringField(unsigned Elt) const
bool isForwardDecl() const
bool isStaticMember() const
unsigned getLineNumber() const
iterator global_variable_end() const
StringRef getName() const
StringRef getFilename() const
DIObjCProperty(const MDNode *N)
unsigned getColumnNumber() const
unsigned getVirtualIndex() const
bool isNameSpace() const
isNameSpace - Return true if the specified tag is DW_TAG_namespace.
bool isEnumerator() const
isEnumerator - Return true if the specified tag is DW_TAG_enumerator.
DIArray(const MDNode *N=0)
unsigned getFlags() const
DITypeRef getClassType() const
DIVariable createInlinedVariable(MDNode *DV, MDNode *InlinedScope, LLVMContext &VMContext)
bool isReadWriteObjCProperty() const
DICompositeType(const MDNode *N=0)
Function * getFunctionField(unsigned Elt) const
bool Verify() const
Verify - Verify that a basic type descriptor is well formed.
bool Verify() const
Verify - Verify that a type descriptor is well formed.
unsigned getArgNumber() const
#define LLVM_EXPLICIT
Expands to explicit on compilers which support explicit conversion operators. Otherwise expands to no...
void print(raw_ostream &OS) const
print - print descriptor.
bool isCopyObjCProperty() const
DIRef< DIType > DITypeRef
void processDeclare(const Module &M, const DbgDeclareInst *DDI)
processDeclare - Process DbgDeclareInst.
bool Verify() const
Verify - Verify that a subprogram descriptor is well formed.
unsigned getRunTimeVersion() const
void dump() const
dump - print descriptor to dbgs() with a newline.
GlobalVariable * getGlobalVariableField(unsigned Elt) const
uint64_t getSizeInBits() const
DenseMap< const MDString *, MDNode * > DITypeIdentifierMap
Maps from type identifier to the actual MDNode.
bool isCompositeType() const
DIVariable(const MDNode *N=0)
bool isObjcClassComplete() const
unsigned type_count() const
iterator scope_end() const
unsigned getFlags() const
DIDerivedType(const MDNode *N=0)
StringRef getName() const
LLVM Value Representation.
StringRef getFilename() const
unsigned getScopeLineNumber() const
DIArray getImportedEntities() const
Constant * getConstant() const
DIScope getContext() const
DITypeRef getTypeDerivedFrom() const
unsigned getColumnNumber() const
DIArray getVariables() const
bool Verify() const
Verify - Verify that a namespace descriptor is well formed.
unsigned getLineNumber() const
bool isDerivedType() const
isDerivedType - Return true if the specified tag is legal for DIDerivedType.
StringRef getDirectory() const
DIRef< DIScope > DIScopeRef
void replaceFunction(Function *F)
NamedMDNode * getFnSpecificMDNode(const Module &M, DISubprogram SP)
DIArray getSubprograms() const
bool isCompileUnit() const
isCompileUnit - Return true if the specified tag is DW_TAG_compile_unit.
bool isExplicit() const
isExplicit - Return true if this subprogram is marked as explicit.
bool isLexicalBlock() const
isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.
DITypeIdentifierMap generateDITypeIdentifierMap(const NamedMDNode *CU_Nodes)
Construct DITypeIdentifierMap by going through retained types of each CU.
bool Verify() const
Verify that the template value parameter descriptor is well formed.
bool isSubrange() const
isSubrange - Return true if the specified tag is DW_TAG_subrange_type.
void printExtendedName(raw_ostream &OS) const
DICompileUnit - A wrapper for a compile unit.
iterator find(const KeyT &Val)
StringRef getProducer() const
StringRef getLinkageName() const
DILexicalBlockFile(const MDNode *N=0)
DITypeRef getType() const
bool isFile() const
isFile - Return true if the specified tag is DW_TAG_file_type.
unsigned getLanguage() const
MDNode * getFileNode() const
Retrieve the MDNode for the directory/file pair.
unsigned getVirtuality() const
StringRef getDisplayName() const
DIBasicType - A basic type, like 'int' or 'float'.
StringRef getSplitDebugFilename() const