mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 15:41:04 +00:00
8a3c587bbe
The data structure can be used to build the JSON input for `resolc` too. In that case serializing of provided custom options should not be dismissed. Makes the memory settings struct more modular as a drive-by. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
29 lines
864 B
Rust
29 lines
864 B
Rust
//! The `resolc --standard-json` polkavm settings.
|
|
//!
|
|
//! Used for options specific to PolkaVM which therefor don't exist in solc.
|
|
|
|
use memory::MemoryConfig;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub mod memory;
|
|
|
|
/// PVM specific compiler settings.
|
|
#[derive(Clone, Copy, Default, Debug, Serialize, Deserialize)]
|
|
pub struct PolkaVM {
|
|
/// The PolkaVM target machine memory configuration settings.
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub memory_config: Option<MemoryConfig>,
|
|
/// Instruct LLVM to emit debug information.
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub debug_information: Option<bool>,
|
|
}
|
|
|
|
impl PolkaVM {
|
|
pub fn new(memory_config: Option<MemoryConfig>, debug_information: bool) -> Self {
|
|
Self {
|
|
memory_config,
|
|
debug_information: Some(debug_information),
|
|
}
|
|
}
|
|
}
|