From 833f34d837eca1e11370fbdea0bcbae10fee70b7 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Tue, 12 May 2015 20:05:31 +0000 Subject: 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 --- llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp') diff --git a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp index 15ad8dc522f..8346345599a 100644 --- a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp +++ b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp @@ -62,8 +62,7 @@ bool ProvenanceAnalysis::relatedPHI(const PHINode *A, // Check each unique source of the PHI node against B. SmallPtrSet UniqueSrc; - for (unsigned i = 0, e = A->getNumIncomingValues(); i != e; ++i) { - const Value *PV1 = A->getIncomingValue(i); + for (Value *PV1 : A->incoming_values()) { if (UniqueSrc.insert(PV1).second && related(PV1, B, DL)) return true; } -- cgit v1.2.3