mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 04:31:08 +00:00
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:
@@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user