Skip to content

Commit 777f7d0

Browse files
committed
Add CodegenBackend enum
1 parent 1cee9c8 commit 777f7d0

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

collector/src/bin/collector.rs

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use clap::{Arg, Parser};
66
use collector::api::next_artifact::NextArtifact;
77
use collector::codegen::{codegen_diff, CodegenType};
88
use collector::compile::benchmark::category::Category;
9+
use collector::compile::benchmark::codegen_backend::CodegenBackend;
910
use collector::compile::benchmark::profile::Profile;
1011
use collector::compile::benchmark::scenario::Scenario;
1112
use collector::compile::benchmark::{
@@ -335,6 +336,10 @@ struct CompileTimeOptions {
335336
)]
336337
scenarios: MultiEnumValue<Scenario>,
337338

339+
/// Measure the codegen backends in this comma-separated list
340+
#[arg(long = "backends", value_parser = EnumArgParser::<CodegenBackend>::default(), default_value = "Llvm")]
341+
codegen_backends: MultiEnumValue<CodegenBackend>,
342+
338343
/// The path to the local rustdoc to measure
339344
#[arg(long)]
340345
rustdoc: Option<PathBuf>,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, clap::ValueEnum, serde::Deserialize)]
2+
#[value(rename_all = "PascalCase")]
3+
pub enum CodegenBackend {
4+
Llvm,
5+
}
6+
7+
impl CodegenBackend {
8+
pub fn all() -> Vec<CodegenBackend> {
9+
vec![CodegenBackend::Llvm]
10+
}
11+
}

collector/src/compile/benchmark/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::path::{Path, PathBuf};
1515
use tempfile::TempDir;
1616

1717
pub mod category;
18+
pub mod codegen_backend;
1819
pub(crate) mod patch;
1920
pub mod profile;
2021
pub mod scenario;

0 commit comments

Comments
 (0)