diff options
author | chriseth <c@ethdev.com> | 2015-05-08 00:31:21 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-11 18:56:40 +0800 |
commit | 2fbcb5b9c81e7922e7cc58a4d75da12ec600e536 (patch) | |
tree | 13dac605ff6ba3a7f31337bebd8e86eb44ad208f /CommonSubexpressionEliminator.h | |
parent | 9d3f0de31bb82217a5fc5f2daf933d21b18774a0 (diff) | |
download | dexon-solidity-2fbcb5b9c81e7922e7cc58a4d75da12ec600e536.tar.gz dexon-solidity-2fbcb5b9c81e7922e7cc58a4d75da12ec600e536.tar.zst dexon-solidity-2fbcb5b9c81e7922e7cc58a4d75da12ec600e536.zip |
Store alternative stack locations during code generation.
Diffstat (limited to 'CommonSubexpressionEliminator.h')
-rw-r--r-- | CommonSubexpressionEliminator.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/CommonSubexpressionEliminator.h b/CommonSubexpressionEliminator.h index 2a9a3125..a35e31d9 100644 --- a/CommonSubexpressionEliminator.h +++ b/CommonSubexpressionEliminator.h @@ -119,10 +119,8 @@ private: void addDependencies(Id _c); /// Produce code that generates the given element if it is not yet present. - /// @returns the stack position of the element or c_invalidPosition if it does not actually - /// generate a value on the stack. /// @param _allowSequenced indicates that sequence-constrained operations are allowed - int generateClassElement(Id _c, bool _allowSequenced = false); + void generateClassElement(Id _c, bool _allowSequenced = false); /// @returns the position of the representative of the given id on the stack. /// @note throws an exception if it is not on the stack. int classElementPosition(Id _id) const; @@ -151,8 +149,8 @@ private: std::multimap<Id, Id> m_neededBy; /// Current content of the stack. std::map<int, Id> m_stack; - /// Current positions of equivalence classes, equal to c_invalidPosition if already deleted. - std::map<Id, int> m_classPositions; + /// Current positions of equivalence classes, equal to the empty set if already deleted. + std::map<Id, std::set<int>> m_classPositions; /// The actual eqivalence class items and how to compute them. ExpressionClasses& m_expressionClasses; |