1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Change a place to use an arbitrary value instead of null, when possible

llvm-svn: 22605
This commit is contained in:
Chris Lattner 2005-08-02 23:29:23 +00:00
parent 239aee9cd3
commit b5906d5783

View File

@ -849,13 +849,13 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
while (!BB->empty()) {
Instruction &I = BB->back();
// If this instruction is used, replace uses with an arbitrary
// constant value. Because control flow can't get here, we don't care
// value. Because control flow can't get here, we don't care
// what we replace the value with. Note that since this block is
// unreachable, and all values contained within it must dominate their
// uses, that all uses will eventually be removed.
if (!I.use_empty())
// Make all users of this instruction reference the constant instead
I.replaceAllUsesWith(Constant::getNullValue(I.getType()));
// Make all users of this instruction use undef instead
I.replaceAllUsesWith(UndefValue::get(I.getType()));
// Remove the instruction from the basic block
BB->getInstList().pop_back();