Skip to content

Commit 3d64253

Browse files
authored
Merge pull request #3 from eth-easl/dandelion-dev
Dandelion dev
2 parents 330e369 + fcd54b6 commit 3d64253

File tree

7 files changed

+521
-232
lines changed

7 files changed

+521
-232
lines changed

src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ pub struct CmdLineOpts {
3434
/// Path to output directory
3535
#[clap(default_value = "./generated")]
3636
output_directory: std::path::PathBuf,
37+
/// Customize the name of the generated Rust crate.
38+
/// Default: sandboxed-<input-file-name-base>
39+
#[clap(long)]
40+
crate_name: Option<String>,
3741
/// Prevent reformatting, for debug purposes
3842
#[clap(short, long)]
3943
prevent_reformat: bool,
@@ -81,6 +85,11 @@ pub struct CmdLineOpts {
8185
/// Generate a `no_std` library, limiting usage to `core` and `alloc`
8286
#[clap(long)]
8387
no_std_library: bool,
88+
/// Generate statically allocated, heapless code (implies --no-std-library,
89+
/// requires --fixed-mem-size)
90+
/// (Warning: experimental performance impact)
91+
#[clap(long)]
92+
no_alloc: bool,
8493
}
8594

8695
fn main() -> Maybe<()> {
@@ -106,6 +115,12 @@ fn main() -> Maybe<()> {
106115
if opts.generate_as_wasi_library {
107116
opts.generate_wasi_executable = true;
108117
}
118+
if opts.no_alloc {
119+
if opts.fixed_mem_size.is_none() {
120+
return Err(eyre!("Must use --fixed-mem-size when using --no-alloc"));
121+
}
122+
opts.no_std_library = true;
123+
}
109124

110125
let inp = std::fs::read(&opts.input_path)?;
111126
println!("Finished reading");

0 commit comments

Comments
 (0)