revive_llvm_builder/
target_triple.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7pub enum TargetTriple {
8 PolkaVM,
10}
11
12impl std::str::FromStr for TargetTriple {
13 type Err = String;
14
15 fn from_str(value: &str) -> Result<Self, Self::Err> {
16 match value {
17 "polkavm" => Ok(Self::PolkaVM),
18 value => Err(format!("Unsupported target triple: `{value}`")),
19 }
20 }
21}
22
23impl std::fmt::Display for TargetTriple {
24 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25 match self {
26 Self::PolkaVM => write!(f, "riscv64-unknown-elf"),
27 }
28 }
29}