OSDN Git Service

[GlobalOpt] Dead Eliminate declarations
authorMehdi Amini <mehdi.amini@apple.com>
Thu, 15 Sep 2016 20:26:27 +0000 (20:26 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Thu, 15 Sep 2016 20:26:27 +0000 (20:26 +0000)
commit12be25f90cec51429d9cb5d9efb15d222d13a4b4
treec20d0fbf389b27c2f0fdaf112bf3159f2802bc58
parent26eccc1ec7911c6dd53d135dd47ce6ea693f520b
[GlobalOpt] Dead Eliminate declarations

GlobalOpt is already dead-code-eliminating global definitions. With
this change it also takes care of declarations.
Hopefully this should make it now a strict superset of GlobalDCE.
This is important for LTO/ThinLTO as we don't want the linker to see
"undefined reference" when it processes the input files: it could
prevent proper internalization (or even load an extra file from a
static archive, changing the behavior of the program!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281653 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalOpt.cpp
test/Transforms/GlobalOpt/deaddeclaration.ll [new file with mode: 0644]