Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
authorChris Lattner <sabre@nondot.org>
Sun, 25 Feb 2007 21:06:13 +0000 (21:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 25 Feb 2007 21:06:13 +0000 (21:06 +0000)
commit1cf55746369af7f1be476cc5c6805806a4bf225d
tree25d89d528825d8e529a05be780e8321c73f53b1d
parent2aef09a06b58516e96fd3d5003ffed03bec2792b
Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
exprs hanging off a global, even if the global is not otherwise dead.  This
requires some tricky iterator gymnastics.

This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34608 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/GlobalValue.h
lib/VMCore/Globals.cpp