mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 04:31:08 +00:00
expose custom PVM settings in the standard json interface (#318)
Exposes the following PolkaVM specific options via the standard json interface: - Heap size - Stack size - Whether to emit source level debug information Additionally it is now forbidden to specify those as CLI option in standard JSON mode. They are bytecode altering options and having multiple ways to specify them creates unnecessary room for confusion: The standard JSON input description should be sufficient and succint for reproducible builds. Closes #290 --------- Signed-off-by: xermicus <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
//! 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.
|
||||
pub memory_config: MemoryConfig,
|
||||
/// Instruct LLVM to emit debug information.
|
||||
pub debug_information: bool,
|
||||
}
|
||||
|
||||
impl PolkaVM {
|
||||
pub fn new(memory_config: Option<MemoryConfig>, debug_information: bool) -> Self {
|
||||
Self {
|
||||
memory_config: memory_config.unwrap_or_default(),
|
||||
debug_information,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user