fe_codegen/yul/mod.rs
1use std::borrow::Cow;
2
3pub mod isel;
4pub mod legalize;
5pub mod runtime;
6
7mod slot_size;
8
9use yultsur::*;
10
11/// A helper struct to abstract ident and expr.
12struct YulVariable<'a>(Cow<'a, str>);
13
14impl<'a> YulVariable<'a> {
15 fn expr(&self) -> yul::Expression {
16 identifier_expression! {(format!{"${}", self.0})}
17 }
18
19 fn ident(&self) -> yul::Identifier {
20 identifier! {(format!{"${}", self.0})}
21 }
22
23 fn new(name: impl Into<Cow<'a, str>>) -> Self {
24 Self(name.into())
25 }
26}