Introduce side-effect-free as relaxed version of movable.

This commit is contained in:
chriseth
2019-05-16 12:30:05 +02:00
parent d172b9bf11
commit e8a88b13e4
8 changed files with 56 additions and 11 deletions
+5
View File
@@ -46,6 +46,8 @@ public:
using ASTWalker::visit;
bool movable() const { return m_movable; }
bool sideEffectFree() const { return m_sideEffectFree; }
std::set<YulString> const& referencedVariables() const { return m_variableReferences; }
private:
@@ -54,6 +56,9 @@ private:
std::set<YulString> m_variableReferences;
/// Is the current expression movable or not.
bool m_movable = true;
/// Is the current expression side-effect free, i.e. can be removed
/// without changing the semantics.
bool m_sideEffectFree = true;
};
/**