From 0063225bd7fa68e94e99bce2bbacb90341d1e667 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 14 Jul 2011 20:22:18 +0000 Subject: [PATCH] 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 --- lib/VMCore/Globals.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index 76fc5a94923..db008e09d1c 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(this)) return F->empty(); - const GlobalAlias *GA = cast(this); - if (const GlobalValue *AV = GA->getAliasedGlobal()) - return AV->isDeclaration(); + // Aliases are always definitions. + assert(isa(this)); return false; } -- 2.34.1