@@ -63,8 +63,8 @@ struct CopyTranslate: public yul::ASTCopier
63
63
{
64
64
using ExternalRefsMap = std::map<yul::Identifier const *, InlineAssemblyAnnotation::ExternalIdentifierInfo>;
65
65
66
- CopyTranslate (yul::Dialect const & _dialect, IRGenerationContext& _context, ExternalRefsMap const & _references):
67
- m_dialect (_dialect), m_context(_context), m_references(_references) {}
66
+ CopyTranslate (IRGenerationContext& _context, ExternalRefsMap const & _references):
67
+ m_context (_context), m_references(_references) {}
68
68
69
69
using ASTCopier::operator ();
70
70
@@ -80,14 +80,11 @@ struct CopyTranslate: public yul::ASTCopier
80
80
81
81
yul::YulName translateIdentifier (yul::YulName _name) override
82
82
{
83
- // Strictly, the dialect used by inline assembly (m_dialect) could be different
84
- // from the Yul dialect we are compiling to. So we are assuming here that the builtin
85
- // functions are identical. This should not be a problem for now since everything
86
- // is EVM anyway.
87
- if (m_dialect.findBuiltin (_name.str ()))
88
- return _name;
89
- else
90
- return yul::YulName{" usr$" + _name.str ()};
83
+ // Strictly, the dialect used by inline assembly could be different
84
+ // from the Yul dialect we are compiling to. By only translating `YulName`s which correspond to Identifiers,
85
+ // we are implicitly excluding builtins together with the assumption, that numerical builtin handles
86
+ // stay identical. Special care has to be taken, that these numerical handles stay consistent.
87
+ return yul::YulName{" usr$" + _name.str ()};
91
88
}
92
89
93
90
yul::Identifier translate (yul::Identifier const & _identifier) override
@@ -209,8 +206,6 @@ struct CopyTranslate: public yul::ASTCopier
209
206
return yul::Identifier{_identifier.debugData , yul::YulName{value}};
210
207
}
211
208
212
-
213
- yul::Dialect const & m_dialect;
214
209
IRGenerationContext& m_context;
215
210
ExternalRefsMap const & m_references;
216
211
};
@@ -2294,7 +2289,7 @@ bool IRGeneratorForStatements::visit(InlineAssembly const& _inlineAsm)
2294
2289
setLocation (_inlineAsm);
2295
2290
if (*_inlineAsm.annotation ().hasMemoryEffects && !_inlineAsm.annotation ().markedMemorySafe )
2296
2291
m_context.setMemoryUnsafeInlineAssemblySeen ();
2297
- CopyTranslate bodyCopier{_inlineAsm. dialect (), m_context, _inlineAsm.annotation ().externalReferences };
2292
+ CopyTranslate bodyCopier{m_context, _inlineAsm.annotation ().externalReferences };
2298
2293
2299
2294
yul::Statement modified = bodyCopier (_inlineAsm.operations ().root ());
2300
2295
0 commit comments