Use a stronger predicate here, pointed out by Duncan
authorChris Lattner <sabre@nondot.org>
Mon, 6 Dec 2010 21:48:10 +0000 (21:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 6 Dec 2010 21:48:10 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121040 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DeadStoreElimination.cpp

index 8c389475a2c7a5d87d58741f46c42dbf16ee7561..adb089ece60bf97cd4f7b5363110b36494ab6cbc 100644 (file)
@@ -277,7 +277,7 @@ static bool isObjectPointerWithTrustworthySize(const Value *V) {
   if (const AllocaInst *AI = dyn_cast<AllocaInst>(V))
     return !AI->isArrayAllocation();
   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
-    return !GV->isWeakForLinker();
+    return !GV->mayBeOverridden();
   if (const Argument *A = dyn_cast<Argument>(V))
     return A->hasByValAttr();
   return false;