Add CLI options for more configuration options (#3603)

This commit adds a few more CLI flags for random fiddly bits in the
`Config` structure to make it a bit easier to play around on the command
line and see the effect of various flags on compiled code.
This commit is contained in:
Alex Crichton
2021-12-16 10:10:19 -06:00
committed by GitHub
parent 4236319a53
commit 48a17e9502

View File

@@ -231,6 +231,19 @@ struct CommonOptions {
/// Enable Cranelift's internal NaN canonicalization
#[structopt(long)]
enable_cranelift_nan_canonicalization: bool,
/// Executing wasm code will consume fuel, limiting its execution.
#[structopt(long)]
consume_fuel: bool,
/// Disables the on-by-default address map from native code to wasm code.
#[structopt(long)]
disable_address_map: bool,
/// Switches memory initialization to happen in a paged fashion instead of
/// the data segments specified in the original wasm module.
#[structopt(long)]
paged_memory_initialization: bool,
}
impl CommonOptions {
@@ -301,6 +314,10 @@ impl CommonOptions {
config.dynamic_memory_guard_size(size);
}
config.consume_fuel(self.consume_fuel);
config.generate_address_map(!self.disable_address_map);
config.paged_memory_initialization(self.paged_memory_initialization);
Ok(config)
}