aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/NameCollector.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/NameCollector.h
parent0a96f091ab63e8d77106e00590a442c59714eecb (diff)
downloaddexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.gz
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.zst
dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.zip
Performance: Replace string by special single-copy YulString class.
Diffstat (limited to 'libyul/optimiser/NameCollector.h')
-rw-r--r--libyul/optimiser/NameCollector.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/libyul/optimiser/NameCollector.h b/libyul/optimiser/NameCollector.h
index b8f6c1d7..b76eec30 100644
--- a/libyul/optimiser/NameCollector.h
+++ b/libyul/optimiser/NameCollector.h
@@ -22,7 +22,6 @@
#include <libyul/optimiser/ASTWalker.h>
-#include <string>
#include <map>
#include <set>
@@ -46,9 +45,9 @@ public:
virtual void operator()(VariableDeclaration const& _varDecl) override;
virtual void operator()(FunctionDefinition const& _funDef) override;
- std::set<std::string> names() const { return m_names; }
+ std::set<YulString> names() const { return m_names; }
private:
- std::set<std::string> m_names;
+ std::set<YulString> m_names;
};
/**
@@ -61,12 +60,12 @@ public:
virtual void operator()(Identifier const& _identifier);
virtual void operator()(FunctionCall const& _funCall);
- static std::map<std::string, size_t> countReferences(Block const& _block);
- static std::map<std::string, size_t> countReferences(Expression const& _expression);
+ static std::map<YulString, size_t> countReferences(Block const& _block);
+ static std::map<YulString, size_t> countReferences(Expression const& _expression);
- std::map<std::string, size_t> const& references() const { return m_references; }
+ std::map<YulString, size_t> const& references() const { return m_references; }
private:
- std::map<std::string, size_t> m_references;
+ std::map<YulString, size_t> m_references;
};
/**
@@ -78,9 +77,9 @@ public:
using ASTWalker::operator ();
virtual void operator()(Assignment const& _assignment) override;
- std::set<std::string> const& names() const { return m_names; }
+ std::set<YulString> const& names() const { return m_names; }
private:
- std::set<std::string> m_names;
+ std::set<YulString> m_names;
};
}