Update StripDeadDebugInfo to use DebugInfoFinder so that it is no longer stale to...
authorMichael Gottesman <mgottesman@apple.com>
Fri, 23 Aug 2013 00:23:24 +0000 (00:23 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Fri, 23 Aug 2013 00:23:24 +0000 (00:23 +0000)
commite0e66b9dfaca5f9cae3bba563b05a6230d64e21d
tree33213673bddcb74ce61fff5f38aaa18b374552d2
parent58a9b4388bcace0f332205f960c6c8705fb5a24b
Update StripDeadDebugInfo to use DebugInfoFinder so that it is no longer stale to the point of not working and more resilient to debug info changes.

The current version of StripDeadDebugInfo became stale and no longer actually
worked since it was expecting an older version of debug info.

This patch updates it to use DebugInfoFinder and the modern DebugInfo classes as
much as possible to make it more redundent to such changes. Additionally, the
only place where that was avoided (the code where we replace the old sets with
the new), I call verify on the DIContextUnit implying that if the format changes
and my live set changes no longer make sense an assert will be hit. In order to
ensure that that occurs I have included a test case.

The actual stripping of the dead debug info follows the same strategy as was
used before in this class: find the live set and replace the old set in the
given compile unit (which may contain dead global variables/functions) with the
new live one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189078 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/StripSymbols.cpp
test/Transforms/StripSymbols/2010-07-01-DeadDbgInfo.ll [deleted file]
test/Transforms/StripSymbols/2010-08-25-crash.ll
test/Transforms/StripSymbols/strip-dead-debug-info.ll [new file with mode: 0644]