OSDN Git Service

DebugInfo: Lazily attach definition attributes to definitions.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 27 May 2014 18:37:43 +0000 (18:37 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 27 May 2014 18:37:43 +0000 (18:37 +0000)
commitdef5a057976fe7ab21c8a6e6ccf1311d20971f4f
tree7882871ea388f82b71e73425f63584a6b062f6ef
parent75325b9f658e1d61d129270ffa5d30bad655d3c4
DebugInfo: Lazily attach definition attributes to definitions.

This is a precursor to fixing inlined debug info where the concrete,
out-of-line definition may preceed any inlined usage. To cope with this,
the attributes that may appear on the concrete definition or the
abstract definition are delayed until the end of the module. Then, if an
abstract definition was created, it is referenced (and no other
attributes are added to the out-of-line definition), otherwise the
attributes are added directly to the out-of-line definition.

In a couple of cases this causes not just reordering of attributes, but
reordering of types. When the creation of the attribute is delayed, if
that creation would create a type (such as for a DW_AT_type attribute)
then other top level DIEs may've been constructed during the delay,
causing the referenced type to be created and added after those
intervening DIEs. In the extreme case, in cross-cu-inlining.ll, this
actually causes the DW_TAG_basic_type for "int" to move from one CU to
another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209674 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll
test/DebugInfo/X86/concrete_out_of_line.ll
test/DebugInfo/X86/dbg-value-inlined-parameter.ll
test/DebugInfo/X86/debug-info-blocks.ll
test/DebugInfo/X86/empty-and-one-elem-array.ll
test/DebugInfo/cross-cu-inlining.ll
test/DebugInfo/namespace_function_definition.ll