diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-01-23 19:40:15 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-01-23 19:40:15 +0000 |
commit | 261734d4cc45b1720ab8a3deedbb62f08d026a1a (patch) | |
tree | 93f751d2adbba6056d4f2e16b04288a5864f238d /lib/VMCore/Instruction.cpp | |
parent | b34045e629edf0b7e1352e9f5d2eb606c1787696 (diff) | |
download | external_llvm-261734d4cc45b1720ab8a3deedbb62f08d026a1a.zip external_llvm-261734d4cc45b1720ab8a3deedbb62f08d026a1a.tar.gz external_llvm-261734d4cc45b1720ab8a3deedbb62f08d026a1a.tar.bz2 |
Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r-- | lib/VMCore/Instruction.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp index b09ab93..f33c1a2 100644 --- a/lib/VMCore/Instruction.cpp +++ b/lib/VMCore/Instruction.cpp @@ -278,8 +278,7 @@ bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const { continue; } - unsigned UseOperand = UI.getOperandNo(); - if (PN->getIncomingBlock(UseOperand/2) != BB) + if (PN->getIncomingBlock(UI) != BB) return true; } return false; |