[llvm] r265360 - use range loop; NFCI

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 16:05:08 PDT 2016


Author: spatel
Date: Mon Apr  4 18:05:06 2016
New Revision: 265360

URL: http://llvm.org/viewvc/llvm-project?rev=265360&view=rev
Log:
use range loop; NFCI

Modified:
    llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=265360&r1=265359&r2=265360&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Mon Apr  4 18:05:06 2016
@@ -63,9 +63,9 @@ FunctionPass *llvm::createConstantPropag
 bool ConstantPropagation::runOnFunction(Function &F) {
   // Initialize the worklist to all of the instructions ready to process...
   std::set<Instruction*> WorkList;
-  for(inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) {
-      WorkList.insert(&*i);
-  }
+  for (Instruction &I: instructions(&F))
+    WorkList.insert(&I);
+
   bool Changed = false;
   const DataLayout &DL = F.getParent()->getDataLayout();
   TargetLibraryInfo *TLI =




More information about the llvm-commits mailing list