diff options
Diffstat (limited to 'lib/Transforms/IPO/GlobalDCE.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalDCE.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index c28d5e3..4f97ae1 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -63,7 +63,7 @@ bool GlobalDCE::runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { Changed |= RemoveUnusedGlobalValue(*I); // Functions with external linkage are needed if they have a body - if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && + if (!I->hasLocalLinkage() && !I->hasLinkOnceLinkage() && !I->isDeclaration()) GlobalIsNeeded(I); } @@ -73,7 +73,7 @@ bool GlobalDCE::runOnModule(Module &M) { Changed |= RemoveUnusedGlobalValue(*I); // Externally visible & appending globals are needed, if they have an // initializer. - if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && + if (!I->hasLocalLinkage() && !I->hasLinkOnceLinkage() && !I->isDeclaration()) GlobalIsNeeded(I); } |