summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.h
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-09-05 18:48:31 +0000
committerManman Ren <manman.ren@gmail.com>2013-09-05 18:48:31 +0000
commitbc66071baa3153ba95d673b8084383835221eef6 (patch)
treeea089a4002af6dfa75f7df34d5da3c0a36b04247 /lib/CodeGen/AsmPrinter/DwarfDebug.h
parent79916948e1fd176a3898b596b679cc9dba3d40a8 (diff)
downloadllvm-bc66071baa3153ba95d673b8084383835221eef6.tar.gz
llvm-bc66071baa3153ba95d673b8084383835221eef6.tar.bz2
llvm-bc66071baa3153ba95d673b8084383835221eef6.tar.xz
Debug Info: Use identifier to reference DIType in base type field of
ptr_to_member. We introduce a new class DITypeRef that represents a reference to a DIType. It wraps around a Value*, which can be either an identifier in MDString or an actual MDNode. The class has a helper function "resolve" that finds the actual MDNode for a given DITypeRef. We specialize getFieldAs to return a field that is a reference to a DIType. To correctly access the base type field of ptr_to_member, getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef. Also add a typedef for DITypeIdentifierMap and a helper generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually populate the map. Verifier is updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 97a454ac9d..0258fdc3db 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -450,6 +450,9 @@ class DwarfDebug {
// Holder for the skeleton information.
DwarfUnits SkeletonHolder;
+ // Maps from a type identifier to the actual MDNode.
+ DITypeIdentifierMap TypeIdentifierMap;
+
private:
void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
@@ -679,6 +682,10 @@ public:
/// Returns the Dwarf Version.
unsigned getDwarfVersion() const { return DwarfVersion; }
+
+ /// Find the MDNode for the given type reference.
+ MDNode *resolve(DITypeRef TRef) const;
+
};
} // End of namespace llvm