From 2fbcb5b9c81e7922e7cc58a4d75da12ec600e536 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 7 May 2015 18:31:21 +0200 Subject: Store alternative stack locations during code generation. --- CommonSubexpressionEliminator.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'CommonSubexpressionEliminator.h') 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 m_neededBy; /// Current content of the stack. std::map m_stack; - /// Current positions of equivalence classes, equal to c_invalidPosition if already deleted. - std::map m_classPositions; + /// Current positions of equivalence classes, equal to the empty set if already deleted. + std::map> m_classPositions; /// The actual eqivalence class items and how to compute them. ExpressionClasses& m_expressionClasses; -- cgit v1.2.3