forked from OSchip/llvm-project
Not having an aliasee is a theoretical possibility.
llvm-svn: 61745
This commit is contained in:
parent
821d13cf78
commit
52e5deece5
|
@ -161,7 +161,8 @@ void GlobalDCE::GlobalIsNeeded(GlobalValue *G) {
|
||||||
MarkUsedGlobalsAsNeeded(GV->getInitializer());
|
MarkUsedGlobalsAsNeeded(GV->getInitializer());
|
||||||
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(G)) {
|
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(G)) {
|
||||||
// The target of a global alias is needed.
|
// The target of a global alias is needed.
|
||||||
MarkUsedGlobalsAsNeeded(GA->getAliasee());
|
if (Constant *Aliasee = GA->getAliasee())
|
||||||
|
MarkUsedGlobalsAsNeeded(Aliasee);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise this must be a function object. We have to scan the body of
|
// 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
|
// the function looking for constants and global values which are used as
|
||||||
|
|
Loading…
Reference in New Issue