//! Process for compiling a single compilation unit. //! The input data. use std::collections::BTreeMap; use std::collections::BTreeSet; use revive_common::MetadataHash; use revive_llvm_context::DebugConfig; use revive_llvm_context::OptimizerSettings; use revive_solc_json_interface::SolcStandardJsonInputSettingsPolkaVMMemory; use serde::Deserialize; use serde::Serialize; use crate::project::contract::Contract; use crate::SolcVersion; /// The input data. #[derive(Debug, Serialize, Deserialize)] pub struct Input { /// The contract representation. pub contract: Contract, /// The `solc` compiler version. pub solc_version: Option, /// Whether to append the metadata hash. pub metadata_hash: MetadataHash, /// The optimizer settings. pub optimizer_settings: OptimizerSettings, /// The debug output config. pub debug_config: DebugConfig, /// The extra LLVM arguments give used for manual control. pub llvm_arguments: Vec, /// The PVM memory configuration. pub memory_config: SolcStandardJsonInputSettingsPolkaVMMemory, /// Missing unlinked libraries. pub missing_libraries: BTreeSet, /// Factory dependencies. pub factory_dependencies: BTreeSet, /// The mapping of auxiliary identifiers, e.g. Yul object names, to full contract paths. pub identifier_paths: BTreeMap, } impl Input { /// A shortcut constructor. pub fn new( contract: Contract, solc_version: Option, metadata_hash: MetadataHash, optimizer_settings: OptimizerSettings, debug_config: DebugConfig, llvm_arguments: Vec, memory_config: SolcStandardJsonInputSettingsPolkaVMMemory, missing_libraries: BTreeSet, factory_dependencies: BTreeSet, identifier_paths: BTreeMap, ) -> Self { Self { contract, solc_version, metadata_hash, optimizer_settings, debug_config, llvm_arguments, memory_config, missing_libraries, factory_dependencies, identifier_paths, } } }