diff options
author | Frederic Riss <friss@apple.com> | 2014-10-23 04:08:42 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2014-10-23 04:08:42 +0000 |
commit | c1892e2d48e4dcc34c55e64b494ddbe723644c68 (patch) | |
tree | c89d4334877af7d56c7be64bedbc6f02b2054b4f /llvm/lib/IR/Value.cpp | |
parent | 05ad2e543f237aea9076f26d9ebddc91200e43f4 (diff) | |
download | bcm5719-llvm-c1892e2d48e4dcc34c55e64b494ddbe723644c68.tar.gz bcm5719-llvm-c1892e2d48e4dcc34c55e64b494ddbe723644c68.zip |
Assert that ValueHandleBase::ValueIsRAUWd doesn't change the tracked Value type.
This invariant is enforced in Value::replaceAllUsesWith, thus it seems
logical to apply it also to ValueHandles. This commit fixes InstCombine
to not trigger the assertion during the removal of constant bitcasts in
call instructions.
Differential Revision: http://reviews.llvm.org/D5828
llvm-svn: 220468
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index 862f08c8966..bda94d057f7 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -773,6 +773,8 @@ void ValueHandleBase::ValueIsDeleted(Value *V) { void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) { assert(Old->HasValueHandle &&"Should only be called if ValueHandles present"); assert(Old != New && "Changing value into itself!"); + assert(Old->getType() == New->getType() && + "replaceAllUses of value with new value of different type!"); // Get the linked list base, which is guaranteed to exist since the // HasValueHandle flag is set. |