Index: src/IceConverter.cpp |
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp |
index 9910f06d17338709a8629f8821873d79064ab73c..9914e9431d3f822334eb91cc4ddc049429d265b5 100644 |
--- a/src/IceConverter.cpp |
+++ b/src/IceConverter.cpp |
@@ -70,9 +70,8 @@ public: |
Func->setInternal(F->hasInternalLinkage()); |
// The initial definition/use of each arg is the entry node. |
- for (Function::const_arg_iterator ArgI = F->arg_begin(), |
- ArgE = F->arg_end(); |
- ArgI != ArgE; ++ArgI) { |
+ for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; |
+ ++ArgI) { |
Func->addArg(mapValueToIceVar(ArgI)); |
} |
@@ -80,14 +79,10 @@ public: |
// blocks in the original linearized order. Otherwise the ICE |
// linearized order will be affected by branch targets in |
// terminator instructions. |
- for (Function::const_iterator BBI = F->begin(), BBE = F->end(); BBI != BBE; |
- ++BBI) { |
- mapBasicBlockToNode(BBI); |
- } |
- for (Function::const_iterator BBI = F->begin(), BBE = F->end(); BBI != BBE; |
- ++BBI) { |
+ for (auto &BBI : *F) |
+ mapBasicBlockToNode(&BBI); |
+ for (auto BBI = F->begin(), BBE = F->end(); BBI != BBE; ++BBI) |
Karl
2014/10/01 15:54:06
Why not range here?
Jim Stichnoth
2014/10/01 19:15:07
Done.
|
convertBasicBlock(BBI); |
- } |
Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock())); |
Func->computePredecessors(); |
@@ -564,8 +559,7 @@ private: |
Ice::CfgNode *convertBasicBlock(const BasicBlock *BB) { |
Ice::CfgNode *Node = mapBasicBlockToNode(BB); |
- for (BasicBlock::const_iterator II = BB->begin(), II_e = BB->end(); |
- II != II_e; ++II) { |
+ for (auto II = BB->begin(), II_e = BB->end(); II != II_e; ++II) { |
Karl
2014/10/01 15:54:06
Why not use a range here?
Jim Stichnoth
2014/10/01 19:15:07
Done.
|
Ice::Inst *Inst = convertInstruction(II); |
Node->appendInst(Inst); |
} |
@@ -632,13 +626,13 @@ void Converter::convertToIce() { |
} |
void Converter::convertFunctions() { |
- for (Module::const_iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) { |
- if (I->empty()) |
+ for (auto &I : *Mod) { |
+ if (I.empty()) |
continue; |
LLVM2ICEConverter FunctionConverter(Ctx, Mod->getContext()); |
Timer TConvert; |
- Cfg *Fcn = FunctionConverter.convertFunction(I); |
+ Cfg *Fcn = FunctionConverter.convertFunction(&I); |
translateFcn(Fcn); |
} |