Move Mode to common crate

This commit is contained in:
James Wilson
2025-08-14 10:42:58 +01:00
parent c94e97cfd0
commit 95ea886ba7
11 changed files with 475 additions and 460 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ use revive_dt_common::types::VersionOrRequirement;
use revive_dt_config::Arguments;
// Re-export this as it's a part of the compiler interface.
pub use revive_dt_format::mode::{Mode, ModeOptimizerSetting, ModePipeline};
pub use revive_dt_common::types::{Mode, ModeOptimizerSetting, ModePipeline};
pub mod revive_js;
pub mod revive_resolc;
+4 -1
View File
@@ -39,7 +39,6 @@ impl SolidityCompiler for Resolc {
async fn build(
&self,
CompilerInput {
// Ignored as we only support one pipeline (Y)
pipeline,
optimization,
evm_version,
@@ -53,6 +52,10 @@ impl SolidityCompiler for Resolc {
}: CompilerInput,
additional_options: Self::Options,
) -> anyhow::Result<CompilerOutput> {
if !matches!(pipeline, None | Some(ModePipeline::Y)) {
anyhow::bail!("Resolc only supports the Y (via Yul IR) pipeline, but the provided pipeline is {pipeline:?}");
}
let input = SolcStandardJsonInput {
language: SolcStandardJsonInputLanguage::Solidity,
sources: sources