1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Add an assertion to catch a misuse of replaceAllUsesWith

llvm-svn: 1924
This commit is contained in:
Chris Lattner 2002-03-21 05:38:15 +00:00
parent c5c31062ab
commit ceb4e429a2

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