mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 02:07:55 +00:00
cffa14a4d2
Provide a modified (and incomplete) version of ZKSync zksolc that can compile the most basic contracts
35 lines
868 B
Rust
35 lines
868 B
Rust
//!
|
|
//! 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),
|
|
}
|
|
}
|
|
}
|