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

Unified Diff: src/IceGlobalContext.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/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 251635f39facc9e8b1b7760758b180834f0a3dad..c2262ad31372201d031f4acbba514a26d276e1e6 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -42,7 +42,7 @@ public:
TypePool() : NextPoolID(0) {}
ValueType *getOrAdd(GlobalContext *Ctx, Type Ty, KeyType Key) {
TupleType TupleKey = std::make_pair(Ty, Key);
- typename ContainerType::const_iterator Iter = Pool.find(TupleKey);
+ auto Iter = Pool.find(TupleKey);
if (Iter != Pool.end())
return Iter->second;
ValueType *Result = ValueType::create(Ctx, Ty, Key, NextPoolID++);
@@ -52,12 +52,8 @@ public:
ConstantList getConstantPool() const {
ConstantList Constants;
Constants.reserve(Pool.size());
- // TODO: replace the loop with std::transform + lambdas.
- for (typename ContainerType::const_iterator I = Pool.begin(),
- E = Pool.end();
- I != E; ++I) {
- Constants.push_back(I->second);
- }
+ for (auto &I : Pool)
+ Constants.push_back(I.second);
return Constants;
}
@@ -86,7 +82,7 @@ public:
UndefPool() : NextPoolID(0) {}
ConstantUndef *getOrAdd(GlobalContext *Ctx, Type Ty) {
- ContainerType::iterator I = Pool.find(Ty);
+ auto I = Pool.find(Ty);
if (I != Pool.end())
return I->second;
ConstantUndef *Undef = ConstantUndef::create(Ctx, Ty, NextPoolID++);
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698