git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265360
91177308-0d34-0410-b5e6-
96231b3b80d8
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 =