mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-26 05:17:58 +00:00
486c9c28a1
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
30 lines
755 B
Rust
30 lines
755 B
Rust
//! The PolkaVM LLVM target triples.
|
|
|
|
/// The list of target triples used as constants.
|
|
///
|
|
/// It must be in the lowercase.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
pub enum TargetTriple {
|
|
/// The PolkaVM RISC-V target triple.
|
|
PolkaVM,
|
|
}
|
|
|
|
impl std::str::FromStr for TargetTriple {
|
|
type Err = String;
|
|
|
|
fn from_str(value: &str) -> Result<Self, Self::Err> {
|
|
match value {
|
|
"polkavm" => Ok(Self::PolkaVM),
|
|
value => Err(format!("Unsupported target triple: `{value}`")),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for TargetTriple {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
|
match self {
|
|
Self::PolkaVM => write!(f, "riscv64-unknown-elf"),
|
|
}
|
|
}
|
|
}
|