diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2015-05-12 20:05:31 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2015-05-12 20:05:31 +0000 |
| commit | 833f34d837eca1e11370fbdea0bcbae10fee70b7 (patch) | |
| tree | 715708db84c3689da9353f39f85088f86359bbe1 /llvm/lib/CodeGen | |
| parent | 26b7aa020bdcabd10ba1c81226327007321aeb89 (diff) | |
| download | bcm5719-llvm-833f34d837eca1e11370fbdea0bcbae10fee70b7.tar.gz bcm5719-llvm-833f34d837eca1e11370fbdea0bcbae10fee70b7.zip | |
Convert PHI getIncomingValue() to foreach over incoming_values(). NFC.
We already had a method to iterate over all the incoming values of a PHI. This just changes all eligible code to use it.
Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB.
llvm-svn: 237169
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 13917f469ea..f37a2874b25 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -3204,8 +3204,8 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr, // For a PHI node, push all of its incoming values. if (PHINode *P = dyn_cast<PHINode>(V)) { - for (unsigned i = 0, e = P->getNumIncomingValues(); i != e; ++i) - worklist.push_back(P->getIncomingValue(i)); + for (Value *IncValue : P->incoming_values()) + worklist.push_back(IncValue); continue; } |

