[dsymutil] Add minimal code to emit DIE trees.
authorFrederic Riss <friss@apple.com>
Wed, 4 Mar 2015 22:07:44 +0000 (22:07 +0000)
committerFrederic Riss <friss@apple.com>
Wed, 4 Mar 2015 22:07:44 +0000 (22:07 +0000)
commitd0d92e7d30ced8b65023d4c2673930cc24104bf3
tree2da5592a99ff954479e87fd7c7e29ea075262ad9
parent17b56820945fbd121017fae0169203471bc39455
[dsymutil] Add minimal code to emit DIE trees.

This commit adds code to emit DIE trees that have been pruned from the
parts that haven't been marked as kept in the previous pass.

It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf)
into a tree of DIE objects. Cloning the DIEs means essentially cloning
their attributes. The code in this commit does only handle scalar and
block attributes (scalar because they are trivial, blocks because they
can't be easily replaced by a scalr placeholder), all the other ones
are replaced by placeholder zero values and will be handled in
further commits.

The added tests mostly check that the DIE tree has the correct layout and
also verify that a few chosen scalar and block attributes correctly make
their way into the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231300 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/dsymutil/X86/basic-linking-x86.test
test/tools/dsymutil/X86/basic-lto-linking-x86.test [new file with mode: 0644]
tools/dsymutil/DwarfLinker.cpp