mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 17:41:05 +00:00
28 lines
763 B
Rust
28 lines
763 B
Rust
//! The Solidity compiler pipeline type.
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::solc::version::Version as SolcVersion;
|
|
|
|
/// The Solidity compiler pipeline type.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
#[allow(non_camel_case_types)]
|
|
#[allow(clippy::upper_case_acronyms)]
|
|
pub enum Pipeline {
|
|
/// The Yul IR.
|
|
Yul,
|
|
/// The EVM legacy assembly IR.
|
|
EVMLA,
|
|
}
|
|
|
|
impl Pipeline {
|
|
/// We always use EVMLA for Solidity <=0.7, or if the user does not want to compile via Yul.
|
|
pub fn new(solc_version: &SolcVersion, force_evmla: bool) -> Self {
|
|
if solc_version.default < crate::solc::FIRST_YUL_VERSION || force_evmla {
|
|
Self::EVMLA
|
|
} else {
|
|
Self::Yul
|
|
}
|
|
}
|
|
}
|