Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_type
authorManman Ren <manman.ren@gmail.com>
Sat, 5 Oct 2013 01:43:03 +0000 (01:43 +0000)
committerManman Ren <manman.ren@gmail.com>
Sat, 5 Oct 2013 01:43:03 +0000 (01:43 +0000)
commitc664d76716ba87577b6c2a513ce4fe0712a2d3e2
tree4b0fd93928b742ceb7221f837dff9eac2a78192f
parentaf76b1601cc1568aa7c672bca6383760b56d2ac4
Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_type
is updated to use DITypeRef.

Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static
helper functions in DwarfCompileUnit. We already have a static helper function
"isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to
resolve the derived-from field. All three functions need to go across link
for derived-from fields, so we need to get hold of a type identifier map.

A pointer to DwarfDebug is also added to DbgVariable in order to resolve the
derived-from field.

Debug info verifier is updated to check a derived-from field is a TypeRef.
Verifier will not go across link for derived-from fields, in debug info finder,
we go across the link to add derived-from fields to types.

Function getDICompositeType is only used by dragonegg and since dragonegg does
not generate identifier for types, we use an empty map to resolve the
derived-from field.

When printing a derived-from field, we use DITypeRef::getName to either return
the type identifier or getName of the DIType.

A paired commit at clang is required due to changes to DIBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192018 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/Linker/Inputs/type-unique-simple2-a.ll [new file with mode: 0644]
test/Linker/Inputs/type-unique-simple2-b.ll [new file with mode: 0644]
test/Linker/type-unique-simple2.ll [new file with mode: 0644]
test/Transforms/LICM/debug-value.ll