summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-14 20:22:18 +0000
committerChris Lattner <sabre@nondot.org>2011-07-14 20:22:18 +0000
commit81210d232d0d467853a0123662def0a9801eed8e (patch)
tree3bddf37045a0f2fd9ed3507c00839f202def7f56 /llvm/lib
parent08ad085712aad00ce252d7dfd2fe2121a481e039 (diff)
downloadbcm5719-llvm-81210d232d0d467853a0123662def0a9801eed8e.tar.gz
bcm5719-llvm-81210d232d0d467853a0123662def0a9801eed8e.zip
Fix GlobalValue::isDeclaration() to always consider aliases to be definitions.
llvm-svn: 135182
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Globals.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Globals.cpp b/llvm/lib/VMCore/Globals.cpp
index 76fc5a94923..db008e09d1c 100644
--- a/llvm/lib/VMCore/Globals.cpp
+++ b/llvm/lib/VMCore/Globals.cpp
@@ -71,9 +71,8 @@ bool GlobalValue::isDeclaration() const {
if (const Function *F = dyn_cast<Function>(this))
return F->empty();
- const GlobalAlias *GA = cast<GlobalAlias>(this);
- if (const GlobalValue *AV = GA->getAliasedGlobal())
- return AV->isDeclaration();
+ // Aliases are always definitions.
+ assert(isa<GlobalAlias>(this));
return false;
}
OpenPOWER on IntegriCloud