mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-02 09:58:06 +00:00
Global variables with APPENDING linkage are very important to keep around!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
894263bc9f
commit
a2d51afd79
@ -48,14 +48,17 @@ bool GlobalDCE::run(Module &M) {
|
||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
|
||||
Changed |= RemoveUnusedConstantPointerRef(*I);
|
||||
// Functions with external linkage are needed if they have a body
|
||||
if (I->hasExternalLinkage() && !I->isExternal())
|
||||
if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) &&
|
||||
!I->isExternal())
|
||||
GlobalIsNeeded(I);
|
||||
}
|
||||
|
||||
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
|
||||
Changed |= RemoveUnusedConstantPointerRef(*I);
|
||||
// Externally visible globals are needed, if they have an initializer.
|
||||
if (I->hasExternalLinkage() && !I->isExternal())
|
||||
// Externally visible & appending globals are needed, if they have an
|
||||
// initializer.
|
||||
if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) &&
|
||||
!I->isExternal())
|
||||
GlobalIsNeeded(I);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user