Projektmodule und vollständiges TBC-Kompilat umsetzen und Change archivieren
This commit is contained in:
@@ -35,12 +35,13 @@ fn generate_module(n_blocks: usize, seed: usize) -> String {
|
||||
}
|
||||
|
||||
fn compile_all(sources: &[(String, String)]) -> usize {
|
||||
let mut total = 0;
|
||||
for (name, src) in sources {
|
||||
let m = tb_vm::compile_source(name, src).expect("Benchmark-Quelle muss kompilieren");
|
||||
total += m.procs.iter().map(|p| p.code.len()).sum::<usize>();
|
||||
}
|
||||
total
|
||||
let units: Vec<_> = sources
|
||||
.iter()
|
||||
.map(|(name, src)| tb_frontend::source::SourceUnit::new(name, &format!("{name}.bas"), src))
|
||||
.collect();
|
||||
let project = tb_vm::compile_project("BENCH", &units, &Default::default(), &[])
|
||||
.expect("Benchmark-Projekt muss kompilieren");
|
||||
project.procs.iter().map(|p| p.code.len()).sum()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user