diff options
author | Duncan Sands <baldrick@free.fr> | 2009-01-05 20:47:56 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-01-05 20:47:56 +0000 |
commit | de77ebcbb9e4554d41ff29608ad716f922e0db98 (patch) | |
tree | 292cb9a4b56787f764819723887d95764a6db060 /lib | |
parent | 15b57506642522a4d0a3b9f15223c4454bcaf401 (diff) | |
download | llvm-de77ebcbb9e4554d41ff29608ad716f922e0db98.tar.gz llvm-de77ebcbb9e4554d41ff29608ad716f922e0db98.tar.bz2 llvm-de77ebcbb9e4554d41ff29608ad716f922e0db98.tar.xz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/IPO/GlobalDCE.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index a9c9ec0fd8..654a5095d0 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<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 |