Emerge Yul recompiler (#1)

Provide a modified (and incomplete) version of ZKSync zksolc that can compile the most basic contracts
This commit is contained in:
Cyrill Leutwiler
2024-03-12 12:06:02 +01:00
committed by GitHub
parent d238d8f39e
commit cffa14a4d2
247 changed files with 35357 additions and 4905 deletions
@@ -0,0 +1,39 @@
//!
//! The LLVM optimizer settings size level.
//!
use serde::Deserialize;
use serde::Serialize;
///
/// The LLVM optimizer settings size level.
///
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
pub enum SizeLevel {
/// No size optimizations.
Zero,
/// The default size optimizations.
S,
/// The aggresize size optimizations.
Z,
}
impl From<SizeLevel> for u32 {
fn from(level: SizeLevel) -> Self {
match level {
SizeLevel::Zero => 0,
SizeLevel::S => 1,
SizeLevel::Z => 2,
}
}
}
impl std::fmt::Display for SizeLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SizeLevel::Zero => write!(f, "0"),
SizeLevel::S => write!(f, "s"),
SizeLevel::Z => write!(f, "z"),
}
}
}