Debug Info: Use identifier to reference DIType in base type field of
authorManman Ren <manman.ren@gmail.com>
Thu, 5 Sep 2013 18:48:31 +0000 (18:48 +0000)
committerManman Ren <manman.ren@gmail.com>
Thu, 5 Sep 2013 18:48:31 +0000 (18:48 +0000)
commitbc66071baa3153ba95d673b8084383835221eef6
treeea089a4002af6dfa75f7df34d5da3c0a36b04247
parent79916948e1fd176a3898b596b679cc9dba3d40a8
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
include/llvm/DebugInfo.h
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/IR/DIBuilder.cpp
lib/IR/DebugInfo.cpp
test/DebugInfo/tu-member-pointer.ll [new file with mode: 0644]