Index: src/IceTargetLowering.h |
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h |
index e87bf936bbea58ec92b84e5f3236671e90337197..fad9303fc5c4cf0519ee475acd9ac24edc7b12f9 100644 |
--- a/src/IceTargetLowering.h |
+++ b/src/IceTargetLowering.h |
@@ -91,6 +91,24 @@ private: |
void advanceForward(InstList::iterator &I) const; |
}; |
+/// A helper class to advance the LoweringContext at each loop iteration. |
+class PostIncrLoweringContext { |
+ PostIncrLoweringContext() = delete; |
+ PostIncrLoweringContext(const PostIncrLoweringContext &) = delete; |
+ PostIncrLoweringContext &operator=(const PostIncrLoweringContext &) = delete; |
+ |
+public: |
+ explicit PostIncrLoweringContext(LoweringContext &Context) |
+ : Context(Context) {} |
+ ~PostIncrLoweringContext() { |
+ Context.advanceCur(); |
+ Context.advanceNext(); |
+ } |
+ |
+private: |
+ LoweringContext &Context; |
+}; |
+ |
class TargetLowering { |
TargetLowering() = delete; |
TargetLowering(const TargetLowering &) = delete; |