[llvm] 91e5096 - [InlineFunction] Use phis() iterator (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 01:36:36 PST 2022


Author: Nikita Popov
Date: 2022-01-28T10:36:28+01:00
New Revision: 91e5096d82d8c4dbfe6f01527c25e16f5e2ba883

URL: https://github.com/llvm/llvm-project/commit/91e5096d82d8c4dbfe6f01527c25e16f5e2ba883
DIFF: https://github.com/llvm/llvm-project/commit/91e5096d82d8c4dbfe6f01527c25e16f5e2ba883.diff

LOG: [InlineFunction] Use phis() iterator (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/InlineFunction.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index c9f872f5b7e1b..39f37b407ff7c 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -671,12 +671,9 @@ static void HandleInlinedEHPad(InvokeInst *II, BasicBlock *FirstNewBlock,
   // edge from this block.
   SmallVector<Value *, 8> UnwindDestPHIValues;
   BasicBlock *InvokeBB = II->getParent();
-  for (Instruction &I : *UnwindDest) {
+  for (PHINode &PHI : UnwindDest->phis()) {
     // Save the value to use for this edge.
-    PHINode *PHI = dyn_cast<PHINode>(&I);
-    if (!PHI)
-      break;
-    UnwindDestPHIValues.push_back(PHI->getIncomingValueForBlock(InvokeBB));
+    UnwindDestPHIValues.push_back(PHI.getIncomingValueForBlock(InvokeBB));
   }
 
   // Add incoming-PHI values to the unwind destination block for the given basic


        


More information about the llvm-commits mailing list