From 674e17c2a895eff6729357d8c10db709ac368b79 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 29 Oct 2018 15:12:02 +0100 Subject: Performance: Replace string by special single-copy YulString class. --- libyul/optimiser/DataFlowAnalyzer.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libyul/optimiser/DataFlowAnalyzer.h') diff --git a/libyul/optimiser/DataFlowAnalyzer.h b/libyul/optimiser/DataFlowAnalyzer.h index 95671467..a0c21eee 100644 --- a/libyul/optimiser/DataFlowAnalyzer.h +++ b/libyul/optimiser/DataFlowAnalyzer.h @@ -24,7 +24,8 @@ #include -#include +#include + #include #include @@ -54,7 +55,7 @@ public: protected: /// Registers the assignment. - void handleAssignment(std::set const& _names, Expression* _value); + void handleAssignment(std::set const& _names, Expression* _value); /// Creates a new inner scope. void pushScope(bool _functionScope); @@ -64,22 +65,22 @@ protected: /// Clears information about the values assigned to the given variables, /// for example at points where control flow is merged. - void clearValues(std::set _names); + void clearValues(std::set _names); /// Returns true iff the variable is in scope. - bool inScope(std::string const& _variableName) const; + bool inScope(YulString _variableName) const; /// Current values of variables, always movable. - std::map m_value; + std::map m_value; /// m_references[a].contains(b) <=> the current expression assigned to a references b - std::map> m_references; + std::map> m_references; /// m_referencedBy[b].contains(a) <=> the current expression assigned to a references b - std::map> m_referencedBy; + std::map> m_referencedBy; struct Scope { explicit Scope(bool _isFunction): isFunction(_isFunction) {} - std::set variables; + std::set variables; bool isFunction; }; /// List of scopes. -- cgit v1.2.3