From 721a5fac62560c4e70137c17e191e458865058ed Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 13 Oct 2002 17:12:47 +0000 Subject: [PATCH] Use methods that are more explanatory llvm-svn: 4142 --- lib/Transforms/IPO/GlobalDCE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 7c81f180bb3..55ef5d42207 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -105,7 +105,7 @@ bool GlobalDCE::RemoveIfDead(GlobalValue *GV) { // Eliminate all global variables that are unused, and that are internal, or // do not have an initializer. // - if (!GVar->hasExternalLinkage() || !GVar->hasInitializer()) { + if (GVar->hasInternalLinkage() || GVar->isExternal()) { Constant *Init = GVar->hasInitializer() ? GVar->getInitializer() : 0; GV->getParent()->getGlobalList().erase(GVar); ++NumVariables;