aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/DataFlowAnalyzer.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-10-29 22:12:02 +0800
committerchriseth <chris@ethereum.org>2018-11-08 02:30:27 +0800
commit674e17c2a895eff6729357d8c10db709ac368b79 (patch)
tree300a55700b068709f36340563db1b43e5b8b1188 /libyul/optimiser/DataFlowAnalyzer.h
parent0a96f091ab63e8d77106e00590a442c59714eecb (diff)
downloaddexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.gz
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.bz2
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.lz
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.xz
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.zst
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.zip
Performance: Replace string by special single-copy YulString class.
Diffstat (limited to 'libyul/optimiser/DataFlowAnalyzer.h')
-rw-r--r--libyul/optimiser/DataFlowAnalyzer.h17
1 files changed, 9 insertions, 8 deletions
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 <libyul/optimiser/ASTWalker.h>
-#include <string>
+#include <libyul/YulString.h>
+
#include <map>
#include <set>
@@ -54,7 +55,7 @@ public:
protected:
/// Registers the assignment.
- void handleAssignment(std::set<std::string> const& _names, Expression* _value);
+ void handleAssignment(std::set<YulString> 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<std::string> _names);
+ void clearValues(std::set<YulString> _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<std::string, Expression const*> m_value;
+ std::map<YulString, Expression const*> m_value;
/// m_references[a].contains(b) <=> the current expression assigned to a references b
- std::map<std::string, std::set<std::string>> m_references;
+ std::map<YulString, std::set<YulString>> m_references;
/// m_referencedBy[b].contains(a) <=> the current expression assigned to a references b
- std::map<std::string, std::set<std::string>> m_referencedBy;
+ std::map<YulString, std::set<YulString>> m_referencedBy;
struct Scope
{
explicit Scope(bool _isFunction): isFunction(_isFunction) {}
- std::set<std::string> variables;
+ std::set<YulString> variables;
bool isFunction;
};
/// List of scopes.