From: Duncan Sands Date: Mon, 5 Jan 2009 20:47:56 +0000 (+0000) Subject: Not having an aliasee is a theoretical possibility. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=de77ebcbb9e4554d41ff29608ad716f922e0db98;p=oota-llvm.git Not having an aliasee is a theoretical possibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61745 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index a9c9ec0fd84..654a5095d06 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -161,7 +161,8 @@ void GlobalDCE::GlobalIsNeeded(GlobalValue *G) { MarkUsedGlobalsAsNeeded(GV->getInitializer()); } else if (GlobalAlias *GA = dyn_cast(G)) { // The target of a global alias is needed. - MarkUsedGlobalsAsNeeded(GA->getAliasee()); + if (Constant *Aliasee = GA->getAliasee()) + MarkUsedGlobalsAsNeeded(Aliasee); } else { // Otherwise this must be a function object. We have to scan the body of // the function looking for constants and global values which are used as