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

Unified Diff: src/IceTargetLowering.h

Issue 619893002: Subzero: Auto-awesome iterators. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add TODOs for rbegin/rend 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
Index: src/IceTargetLowering.h
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 1995124826d066cffd229671e1bc4066c58e9162..d08311d6c7d17b041da94c001b03fe2c919c2569 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -52,6 +52,9 @@ public:
bool atEnd() const { return Cur == End; }
InstList::iterator getCur() const { return Cur; }
InstList::iterator getEnd() const { return End; }
+ // Adaptor to enable range-based for loops.
+ InstList::iterator begin() const { return getCur(); }
+ InstList::iterator end() const { return getEnd(); }
void insert(Inst *Inst);
Inst *getLastInserted() const;
void advanceCur() { Cur = Next; }
« src/IceCfg.cpp ('K') | « src/IceRegAlloc.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698