Chromium Code Reviews| Index: src/IceUtils.h |
| diff --git a/src/IceUtils.h b/src/IceUtils.h |
| index f9b03bc75b1f65da97b6f1dc5494750b36af500f..1f57e4dfc13e7984009d15334cace680f5abb94a 100644 |
| --- a/src/IceUtils.h |
| +++ b/src/IceUtils.h |
| @@ -123,6 +123,22 @@ template <typename T> static bool isPositiveZero(T Val) { |
| return Val == 0 && !std::signbit(Val); |
| } |
| +/// A helper class to ease the settings of RandomizationPoolingPause to disable |
|
Jim Stichnoth
2016/02/12 22:41:31
This comment is now completely wrong. :)
|
| +/// constant blinding or pooling for some translation phases. |
| +class BoolFlagSaver { |
| + BoolFlagSaver() = delete; |
| + BoolFlagSaver(const BoolFlagSaver &) = delete; |
| + BoolFlagSaver &operator=(const BoolFlagSaver &) = delete; |
| + |
| +public: |
| + BoolFlagSaver(bool &F, bool NewValue) : OldValue(F), Flag(F) { F = NewValue; } |
| + ~BoolFlagSaver() { Flag = OldValue; } |
| + |
| +private: |
| + const bool OldValue; |
| + bool &Flag; |
| +}; |
| + |
| } // end of namespace Utils |
| } // end of namespace Ice |