mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 13:01:06 +00:00
remove system mode and request memoization
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -51,7 +51,6 @@ pub fn yul(
|
||||
input_files: &[PathBuf],
|
||||
solc: &mut SolcCompiler,
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
is_system_mode: bool,
|
||||
include_metadata_hash: bool,
|
||||
debug_config: Option<revive_llvm_context::DebugConfig>,
|
||||
) -> anyhow::Result<Build> {
|
||||
@@ -64,27 +63,17 @@ pub fn yul(
|
||||
),
|
||||
};
|
||||
|
||||
let solc_validator = if is_system_mode {
|
||||
None
|
||||
} else {
|
||||
if solc.version()?.default != SolcCompiler::LAST_SUPPORTED_VERSION {
|
||||
anyhow::bail!(
|
||||
if solc.version()?.default != SolcCompiler::LAST_SUPPORTED_VERSION {
|
||||
anyhow::bail!(
|
||||
"The Yul mode is only supported with the most recent version of the Solidity compiler: {}",
|
||||
SolcCompiler::LAST_SUPPORTED_VERSION,
|
||||
);
|
||||
}
|
||||
|
||||
Some(&*solc)
|
||||
};
|
||||
}
|
||||
|
||||
let solc_validator = Some(&*solc);
|
||||
let project = Project::try_from_yul_path(path, solc_validator)?;
|
||||
|
||||
let build = project.compile(
|
||||
optimizer_settings,
|
||||
is_system_mode,
|
||||
include_metadata_hash,
|
||||
debug_config,
|
||||
)?;
|
||||
let build = project.compile(optimizer_settings, include_metadata_hash, debug_config)?;
|
||||
|
||||
Ok(build)
|
||||
}
|
||||
@@ -93,7 +82,6 @@ pub fn yul(
|
||||
pub fn llvm_ir(
|
||||
input_files: &[PathBuf],
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
is_system_mode: bool,
|
||||
include_metadata_hash: bool,
|
||||
debug_config: Option<revive_llvm_context::DebugConfig>,
|
||||
) -> anyhow::Result<Build> {
|
||||
@@ -108,12 +96,7 @@ pub fn llvm_ir(
|
||||
|
||||
let project = Project::try_from_llvm_ir_path(path)?;
|
||||
|
||||
let build = project.compile(
|
||||
optimizer_settings,
|
||||
is_system_mode,
|
||||
include_metadata_hash,
|
||||
debug_config,
|
||||
)?;
|
||||
let build = project.compile(optimizer_settings, include_metadata_hash, debug_config)?;
|
||||
|
||||
Ok(build)
|
||||
}
|
||||
@@ -128,7 +111,6 @@ pub fn standard_output(
|
||||
solc_optimizer_enabled: bool,
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
force_evmla: bool,
|
||||
is_system_mode: bool,
|
||||
include_metadata_hash: bool,
|
||||
base_path: Option<String>,
|
||||
include_paths: Vec<String>,
|
||||
@@ -152,7 +134,6 @@ pub fn standard_output(
|
||||
None,
|
||||
&solc_version.default,
|
||||
optimizer_settings.is_fallback_to_size_enabled(),
|
||||
optimizer_settings.is_system_request_memoization_disabled(),
|
||||
),
|
||||
None,
|
||||
solc_pipeline == SolcPipeline::Yul,
|
||||
@@ -198,12 +179,7 @@ pub fn standard_output(
|
||||
debug_config.as_ref(),
|
||||
)?;
|
||||
|
||||
let build = project.compile(
|
||||
optimizer_settings,
|
||||
is_system_mode,
|
||||
include_metadata_hash,
|
||||
debug_config,
|
||||
)?;
|
||||
let build = project.compile(optimizer_settings, include_metadata_hash, debug_config)?;
|
||||
|
||||
Ok(build)
|
||||
}
|
||||
@@ -214,7 +190,6 @@ pub fn standard_json(
|
||||
solc: &mut SolcCompiler,
|
||||
detect_missing_libraries: bool,
|
||||
force_evmla: bool,
|
||||
is_system_mode: bool,
|
||||
base_path: Option<String>,
|
||||
include_paths: Vec<String>,
|
||||
allow_paths: Option<String>,
|
||||
@@ -275,12 +250,7 @@ pub fn standard_json(
|
||||
&resolc_version,
|
||||
)?;
|
||||
} else {
|
||||
let build = project.compile(
|
||||
optimizer_settings,
|
||||
is_system_mode,
|
||||
include_metadata_hash,
|
||||
debug_config,
|
||||
)?;
|
||||
let build = project.compile(optimizer_settings, include_metadata_hash, debug_config)?;
|
||||
build.write_to_standard_json(&mut solc_output, &solc_version, &resolc_version)?;
|
||||
}
|
||||
serde_json::to_writer(std::io::stdout(), &solc_output)?;
|
||||
@@ -298,7 +268,6 @@ pub fn combined_json(
|
||||
solc_optimizer_enabled: bool,
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
force_evmla: bool,
|
||||
is_system_mode: bool,
|
||||
include_metadata_hash: bool,
|
||||
base_path: Option<String>,
|
||||
include_paths: Vec<String>,
|
||||
@@ -319,7 +288,6 @@ pub fn combined_json(
|
||||
solc_optimizer_enabled,
|
||||
optimizer_settings,
|
||||
force_evmla,
|
||||
is_system_mode,
|
||||
include_metadata_hash,
|
||||
base_path,
|
||||
include_paths,
|
||||
|
||||
Reference in New Issue
Block a user