Add an assertion to catch a misuse of replaceAllUsesWith

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-03-21 05:38:15 +00:00
parent 60091fa6b1
commit 150dcb9e2d

View File

@ -50,6 +50,8 @@ Value::~Value() {
void Value::replaceAllUsesWith(Value *D) {
assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!");
assert(D->getType() == getType() &&
"replaceAllUses of value with new value of different type!");
while (!Uses.empty()) {
User *Use = Uses.back();
#ifndef NDEBUG