vicis_core/ir/module/linkage/
mod.rs

1pub mod parser;
2
3pub use parser::parse;
4
5use std::fmt;
6
7#[derive(Clone, Copy)]
8pub enum Linkage {
9    Private,
10    Internal,
11    External,
12    ExternalWeak,
13    AvailableExternally,
14    LinkOnceAny,
15    LinkOnceODR,
16    LinkOnceODRAutoHide,
17    WeakAny,
18    WeakODR,
19    Common,
20    Appending,
21    DLLImport,
22    DLLExport,
23    Ghost,
24    LinkerPrivate,
25    LinkerPrivateWeak,
26}
27
28impl fmt::Debug for Linkage {
29    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30        match self {
31            Self::Private => write!(f, "private"),
32            Self::Internal => write!(f, "internal"),
33            Self::External => write!(f, "external"),
34            Self::ExternalWeak => write!(f, "externalweak"),
35            Self::AvailableExternally => write!(f, "availableexternally"),
36            Self::LinkOnceAny => write!(f, "linkonceany"),
37            Self::LinkOnceODR => write!(f, "linkonceodr"),
38            Self::LinkOnceODRAutoHide => write!(f, "linkonceodrautohide"),
39            Self::WeakAny => write!(f, "weakany"),
40            Self::WeakODR => write!(f, "weakodr"),
41            Self::Common => write!(f, "common"),
42            Self::Appending => write!(f, "appending"),
43            Self::DLLImport => write!(f, "dllimport"),
44            Self::DLLExport => write!(f, "dllexport"),
45            Self::Ghost => write!(f, "ghost"),
46            Self::LinkerPrivate => write!(f, "linkerprivate"),
47            Self::LinkerPrivateWeak => write!(f, "linkerprivateweak"),
48        }
49    }
50}