Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: src/PNaClTranslator.cpp

Issue 619893002: Subzero: Auto-awesome iterators. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use AsmCodeByte instead of uint8_t Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTypeConverter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index c160daa6fe4a8f0a519117c9f600f2d1c640dc19..0571b297a96a9aeb3d45318f4c35998f6a8ed383 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -847,8 +847,7 @@ public:
Func->setInternal(LLVMFunc->hasInternalLinkage());
CurrentNode = InstallNextBasicBlock();
Func->setEntryNode(CurrentNode);
- for (Function::const_arg_iterator ArgI = LLVMFunc->arg_begin(),
- ArgE = LLVMFunc->arg_end();
+ for (auto ArgI = LLVMFunc->arg_begin(), ArgE = LLVMFunc->arg_end();
ArgI != ArgE; ++ArgI) {
Func->addArg(getNextInstVar(Context->convertToIceType(ArgI->getType())));
}
@@ -1387,11 +1386,7 @@ void FunctionParser::ExitBlock() {
// Before translating, check for blocks without instructions, and
// insert unreachable. This shouldn't happen, but be safe.
unsigned Index = 0;
- const Ice::NodeList &Nodes = Func->getNodes();
- for (std::vector<Ice::CfgNode *>::const_iterator Iter = Nodes.begin(),
- IterEnd = Nodes.end();
- Iter != IterEnd; ++Iter, ++Index) {
- Ice::CfgNode *Node = *Iter;
+ for (Ice::CfgNode *Node : Func->getNodes()) {
if (Node->getInsts().size() == 0) {
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
@@ -1400,6 +1395,7 @@ void FunctionParser::ExitBlock() {
// TODO(kschimpf) Remove error recovery once implementation complete.
Node->appendInst(Ice::InstUnreachable::create(Func));
}
+ ++Index;
}
Func->computePredecessors();
// Note: Once any errors have been found, we turn off all
« no previous file with comments | « src/IceTypeConverter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698