Skip to content

Commit ad281dd

Browse files
authored
Merge pull request #15951 from ethereum/disambiguator_dont_check_for_builtin
Yul Disambiguator: Don't check for builtins when translating identifiers
2 parents b53eba3 + f2c9eec commit ad281dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: libyul/optimiser/Disambiguator.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ using namespace solidity;
3030
using namespace solidity::yul;
3131
using namespace solidity::util;
3232

33-
YulName Disambiguator::translateIdentifier(YulName _originalName)
33+
YulName Disambiguator::translateIdentifier(YulName const _originalName)
3434
{
35-
if (m_dialect.findBuiltin(_originalName.str()) || m_externallyUsedIdentifiers.count(_originalName))
35+
if (m_externallyUsedIdentifiers.contains(_originalName))
3636
return _originalName;
3737

3838
assertThrow(!m_scopes.empty() && m_scopes.back(), OptimizerException, "");
3939
Scope::Identifier const* id = m_scopes.back()->lookup(_originalName);
4040
assertThrow(id, OptimizerException, "");
41-
if (!m_translations.count(id))
41+
if (!m_translations.contains(id))
4242
m_translations[id] = m_nameDispenser.newName(_originalName);
4343
return m_translations.at(id);
4444
}

Diff for: libyul/optimiser/Disambiguator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Disambiguator: public ASTCopier
5656
void leaveScope(Block const& _block) override;
5757
void enterFunction(FunctionDefinition const& _function) override;
5858
void leaveFunction(FunctionDefinition const& _function) override;
59-
YulName translateIdentifier(YulName _name) override;
59+
YulName translateIdentifier(YulName _originalName) override;
6060

6161
void enterScopeInternal(Scope& _scope);
6262
void leaveScopeInternal(Scope& _scope);

0 commit comments

Comments
 (0)