llvm_scratch/core/target_triple/
triple.rs

1use std::fmt;
2
3use crate::core::target_triple as tt;
4
5#[derive(PartialEq, PartialOrd, Eq, Ord, Debug)]
6pub struct TargetTriple {
7    pub architecture: tt::Arch,
8    pub sub: Option<tt::Sub>,
9    pub vendor: tt::Vendor,
10    pub sys: tt::Sys,
11    pub abi: tt::ABI,
12}
13
14impl fmt::Display for TargetTriple {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match &self.sub {
17            Some(sub) => write!(
18                f,
19                "{}{}-{}-{}-{}",
20                self.architecture, sub, self.vendor, self.sys, self.abi
21            ),
22            None => write!(
23                f,
24                "{}-{}-{}-{}",
25                self.architecture, self.vendor, self.sys, self.abi
26            ),
27        }
28    }
29}