[llvm-commits] [llvm] r61745 - /llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp

Duncan Sands baldrick at free.fr
Mon Jan 5 12:47:56 PST 2009


Author: baldrick
Date: Mon Jan  5 14:47:56 2009
New Revision: 61745

URL: http://llvm.org/viewvc/llvm-project?rev=61745&view=rev
Log:
Not having an aliasee is a theoretical possibility.

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=61745&r1=61744&r2=61745&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Mon Jan  5 14:47:56 2009
@@ -161,7 +161,8 @@
       MarkUsedGlobalsAsNeeded(GV->getInitializer());
   } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(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





More information about the llvm-commits mailing list