pub use self::opcode::*;
pub use self::ty::*;
pub use self::value::*;
pub use self::context::*;
pub use self::module::*;
pub use self::attributes::*;
pub use self::block::*;
pub use self::function::*;
pub use self::passes::*;
pub mod opcode;
pub mod ty;
pub mod value;
pub mod context;
pub mod module;
pub mod attributes;
pub mod block;
pub mod function;
pub mod passes;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum Linkage
{
External = 0,
AvailableExternally,
LinkOnceAny,
LinkOnceODR,
WeakAny,
WeakODR,
Appending,
Internal,
Private,
ExternalWeak,
Common,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum AtomicOrdering
{
NotAtomic = 0,
Unordered = 1,
Monotonic = 2,
Acquire = 4,
Release = 5,
AcquireRelease = 6,
SequentiallyConsistent = 7,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum SynchronizationScope
{
SingleThread = 0,
CrossThread = 1,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum ThreadLocalMode
{
NotThreadLocal = 0,
GeneralDynamic,
LocalDynamic,
InitialExec,
LocalExec,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum FloatPredicateKind
{
False = 0,
OrderedAndEqual = 1,
OrderedGreaterThan = 2,
OrderedGreaterThanOrEqual = 3,
OrderedLessThan = 4,
OrderedLessThanOrEqual = 5,
OrderedUnequal = 6,
Ordered = 7,
Unordered = 8,
UnorderedOrEqual = 9,
UnorderedOrGreaterThan = 10,
UnorderedOrGreaterThanOrEqual = 11,
UnorderedOrLessThan = 12,
UnorderedOrLessThanOrEqual = 13,
UnorderedOrNotEqual = 14,
True = 15,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum IntegerPredicateKind
{
Equal = 32,
NotEqual = 33,
UnsignedGreaterThan = 34,
UnsignedGreaterThanOrEqual = 35,
UnsignedLessThan = 36,
UnsignedLessThanOrEqual = 37,
SignedGreaterThan = 38,
SignedGreaterThanOrEqual = 39,
SignedLessThan = 40,
SignedLessThanOrEqual = 41,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub enum AtomicBinaryOp
{
Xchg,
Add,
Sub,
And,
Nand,
Or,
Xor,
Max,
Min,
UMax,
UMin,
}
#[cfg(test)]
mod test
{
use ir;
use std::mem;
use libc;
#[test]
fn linkage_ints_are_correct() {
assert_eq!(ir::Linkage::External as u32, 0);
assert_eq!(ir::Linkage::Private as u32, 8);
}
#[test]
fn linkage_is_c_unsigned() {
assert_eq!(mem::size_of::<ir::Linkage>(), mem::size_of::<libc::c_uint>());
}
}