aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/NameDispenser.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2019-01-08 00:23:05 +0800
committerGitHub <noreply@github.com>2019-01-08 00:23:05 +0800
commit9f5d34af7de481c5b8ce89057a6df2a3283d14b0 (patch)
tree273c2c234e637a8c33ebbe041d8f2c4f8ef99c51 /libyul/optimiser/NameDispenser.h
parent165a6891212bd440a65da4084a823dccbf83a433 (diff)
parent9222eff08fad8e6a0ea7df8b299880f90c68c8b3 (diff)
downloaddexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.tar.gz
dexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.tar.zst
dexon-solidity-9f5d34af7de481c5b8ce89057a6df2a3283d14b0.zip
Merge pull request #5752 from ethereum/addDialect
[Yul] Refactor: Make the dialect available everywhere.
Diffstat (limited to 'libyul/optimiser/NameDispenser.h')
-rw-r--r--libyul/optimiser/NameDispenser.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libyul/optimiser/NameDispenser.h b/libyul/optimiser/NameDispenser.h
index 664a5265..719743e6 100644
--- a/libyul/optimiser/NameDispenser.h
+++ b/libyul/optimiser/NameDispenser.h
@@ -27,6 +27,7 @@
namespace yul
{
+struct Dialect;
/**
* Optimizer component that can be used to generate new names that
@@ -38,9 +39,9 @@ class NameDispenser
{
public:
/// Initialize the name dispenser with all the names used in the given AST.
- explicit NameDispenser(Block const& _ast);
+ explicit NameDispenser(Dialect const& _dialect, Block const& _ast);
/// Initialize the name dispenser with the given used names.
- explicit NameDispenser(std::set<YulString> _usedNames);
+ explicit NameDispenser(Dialect const& _dialect, std::set<YulString> _usedNames);
/// @returns a currently unused name that should be similar to _nameHint
/// and prefixed by _context if present.
@@ -51,6 +52,7 @@ public:
private:
YulString newNameInternal(YulString _nameHint);
+ Dialect const& m_dialect;
std::set<YulString> m_usedNames;
size_t m_counter = 0;
};