summaryrefslogtreecommitdiff
path: root/lib/VMCore/Globals.cpp
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
commit0063225bd7fa68e94e99bce2bbacb90341d1e667 (patch)
tree8a39b2ca911751cd2bf2b6e7b00a5509411a378d /lib/VMCore/Globals.cpp
parent5427edeb68d653ced860ed14f83848ebbb01b64b (diff)
downloadllvm-0063225bd7fa68e94e99bce2bbacb90341d1e667.tar.gz
llvm-0063225bd7fa68e94e99bce2bbacb90341d1e667.tar.bz2
llvm-0063225bd7fa68e94e99bce2bbacb90341d1e667.tar.xz
Fix GlobalValue::isDeclaration() to always consider aliases to be definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Globals.cpp')
-rw-r--r--lib/VMCore/Globals.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp
index 76fc5a9492..db008e09d1 100644
--- a/lib/VMCore/Globals.cpp
+++ b/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;
}