llvm-scratch 0.1.15

Free Standing library in Rust
Documentation
use std::fmt;

#[derive(PartialEq, PartialOrd, Eq, Ord, Debug)]
pub enum Mangling {
    ELF,
    MIPS,
    MACHO,
    WINDOWSX86COFF,
    WINDOWSCOFF,
}

impl fmt::Display for Mangling {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let mangling_str = match self {
            Self::ELF => 'e',
            Self::MIPS => 'm',
            Self::MACHO => 'o',
            Self::WINDOWSX86COFF => 'x',
            Self::WINDOWSCOFF => 'w',
        };

        write!(f, "m:{}", mangling_str)
    }
}