mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 05:38:00 +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,34 @@
|
||||
//!
|
||||
//! The LLVM IR generator EVM legacy assembly data.
|
||||
//!
|
||||
|
||||
use crate::eravm::context::argument::Argument;
|
||||
|
||||
///
|
||||
/// The LLVM IR generator EVM legacy assembly data.
|
||||
///
|
||||
/// Describes some data that is only relevant to the EVM legacy assembly.
|
||||
///
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct EVMLAData<'ctx> {
|
||||
/// The Solidity compiler version.
|
||||
/// Some instruction behave differenly depending on the version.
|
||||
pub version: semver::Version,
|
||||
/// The static stack allocated for the current function.
|
||||
pub stack: Vec<Argument<'ctx>>,
|
||||
}
|
||||
|
||||
impl<'ctx> EVMLAData<'ctx> {
|
||||
/// The default stack size.
|
||||
pub const DEFAULT_STACK_SIZE: usize = 64;
|
||||
|
||||
///
|
||||
/// A shortcut constructor.
|
||||
///
|
||||
pub fn new(version: semver::Version) -> Self {
|
||||
Self {
|
||||
version,
|
||||
stack: Vec::with_capacity(Self::DEFAULT_STACK_SIZE),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user