Fix GlobalValue::isDeclaration() to always consider aliases to be definitions.
authorChris Lattner <sabre@nondot.org>
Thu, 14 Jul 2011 20:22:18 +0000 (20:22 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Jul 2011 20:22:18 +0000 (20:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Globals.cpp

index 76fc5a9492352690a193742f7a1604ceef60d8f9..db008e09d1c86dcff43ec3476038f00944b01ab5 100644 (file)
@@ -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;
 }