use libc::{c_ulonglong, c_void};
use std::marker::PhantomData;
+use traits;
use super::RustString;
IntSLE = 41,
}
+impl IntPredicate {
+ pub fn from_generic(intpre: traits::IntPredicate) -> Self {
+ match intpre {
+ traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
+ traits::IntPredicate::IntNE => IntPredicate::IntNE,
+ traits::IntPredicate::IntUGT => IntPredicate::IntUGT,
+ traits::IntPredicate::IntUGE => IntPredicate::IntUGE,
+ traits::IntPredicate::IntULT => IntPredicate::IntULT,
+ traits::IntPredicate::IntULE => IntPredicate::IntULE,
+ traits::IntPredicate::IntSGT => IntPredicate::IntSGT,
+ traits::IntPredicate::IntSGE => IntPredicate::IntSGE,
+ traits::IntPredicate::IntSLT => IntPredicate::IntSLT,
+ traits::IntPredicate::IntSLE => IntPredicate::IntSLE,
+ }
+ }
+}
+
/// LLVMRealPredicate
#[derive(Copy, Clone)]
#[repr(C)]
RealPredicateTrue = 15,
}
+impl RealPredicate {
+ pub fn from_generic(realpred: traits::RealPredicate) -> Self {
+ match realpred {
+ traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
+ traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
+ traits::RealPredicate::RealOGT => RealPredicate::RealOGT,
+ traits::RealPredicate::RealOGE => RealPredicate::RealOGE,
+ traits::RealPredicate::RealOLT => RealPredicate::RealOLT,
+ traits::RealPredicate::RealOLE => RealPredicate::RealOLE,
+ traits::RealPredicate::RealONE => RealPredicate::RealONE,
+ traits::RealPredicate::RealORD => RealPredicate::RealORD,
+ traits::RealPredicate::RealUNO => RealPredicate::RealUNO,
+ traits::RealPredicate::RealUEQ => RealPredicate::RealUEQ,
+ traits::RealPredicate::RealUGT => RealPredicate::RealUGT,
+ traits::RealPredicate::RealUGE => RealPredicate::RealUGE,
+ traits::RealPredicate::RealULT => RealPredicate::RealULT,
+ traits::RealPredicate::RealULE => RealPredicate::RealULE,
+ traits::RealPredicate::RealUNE => RealPredicate::RealUNE,
+ traits::RealPredicate::RealPredicateTrue => RealPredicate::RealPredicateTrue
+ }
+ }
+}
+
/// LLVMTypeKind
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(C)]
AtomicUMin = 10,
}
+impl AtomicRmwBinOp {
+ pub fn from_generic(op : traits::AtomicRmwBinOp) -> Self {
+ match op {
+ traits::AtomicRmwBinOp::AtomicXchg => AtomicRmwBinOp::AtomicXchg,
+ traits::AtomicRmwBinOp::AtomicAdd => AtomicRmwBinOp::AtomicAdd,
+ traits::AtomicRmwBinOp::AtomicSub => AtomicRmwBinOp::AtomicSub,
+ traits::AtomicRmwBinOp::AtomicAnd => AtomicRmwBinOp::AtomicAnd,
+ traits::AtomicRmwBinOp::AtomicNand => AtomicRmwBinOp::AtomicNand,
+ traits::AtomicRmwBinOp::AtomicOr => AtomicRmwBinOp::AtomicOr,
+ traits::AtomicRmwBinOp::AtomicXor => AtomicRmwBinOp::AtomicXor,
+ traits::AtomicRmwBinOp::AtomicMax => AtomicRmwBinOp::AtomicMax,
+ traits::AtomicRmwBinOp::AtomicMin => AtomicRmwBinOp::AtomicMin,
+ traits::AtomicRmwBinOp::AtomicUMax => AtomicRmwBinOp::AtomicUMax,
+ traits::AtomicRmwBinOp::AtomicUMin => AtomicRmwBinOp::AtomicUMin
+ }
+ }
+}
+
/// LLVMAtomicOrdering
#[derive(Copy, Clone)]
#[repr(C)]
SequentiallyConsistent = 7,
}
+impl AtomicOrdering {
+ pub fn from_generic(ao : traits::AtomicOrdering) -> Self {
+ match ao {
+ traits::AtomicOrdering::NotAtomic => AtomicOrdering::NotAtomic,
+ traits::AtomicOrdering::Unordered => AtomicOrdering::Unordered,
+ traits::AtomicOrdering::Monotonic => AtomicOrdering::Monotonic,
+ traits::AtomicOrdering::Acquire => AtomicOrdering::Acquire,
+ traits::AtomicOrdering::Release => AtomicOrdering::Release,
+ traits::AtomicOrdering::AcquireRelease => AtomicOrdering::AcquireRelease,
+ traits::AtomicOrdering::SequentiallyConsistent =>
+ AtomicOrdering::SequentiallyConsistent
+ }
+ }
+}
+
+
/// LLVMRustSynchronizationScope
#[derive(Copy, Clone)]
#[repr(C)]
CrossThread,
}
+impl SynchronizationScope {
+ pub fn from_generic(sc : traits::SynchronizationScope) -> Self {
+ match sc {
+ traits::SynchronizationScope::Other => SynchronizationScope::Other,
+ traits::SynchronizationScope::SingleThread => SynchronizationScope::SingleThread,
+ traits::SynchronizationScope::CrossThread => SynchronizationScope::CrossThread,
+ }
+ }
+}
+
/// LLVMRustFileType
#[derive(Copy, Clone)]
#[repr(C)]
Bundle: Option<&OperandBundleDef<'a>>,
Name: *const c_char)
-> &'a Value;
+ pub fn LLVMRustBuildMemCpy(B: &Builder<'a>,
+ Dst: &'a Value,
+ DstAlign: c_uint,
+ Src: &'a Value,
+ SrcAlign: c_uint,
+ Size: &'a Value,
+ IsVolatile: bool)
+ -> &'a Value;
+ pub fn LLVMRustBuildMemMove(B: &Builder<'a>,
+ Dst: &'a Value,
+ DstAlign: c_uint,
+ Src: &'a Value,
+ SrcAlign: c_uint,
+ Size: &'a Value,
+ IsVolatile: bool)
+ -> &'a Value;
pub fn LLVMBuildSelect(B: &Builder<'a>,
If: &'a Value,
Then: &'a Value,
pub fn LLVMRustBuildVectorReduceFAdd(B: &Builder<'a>,
Acc: &'a Value,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceFMul(B: &Builder<'a>,
Acc: &'a Value,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceAdd(B: &Builder<'a>,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceMul(B: &Builder<'a>,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceAnd(B: &Builder<'a>,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceOr(B: &Builder<'a>,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceXor(B: &Builder<'a>,
Src: &'a Value)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceMin(B: &Builder<'a>,
Src: &'a Value,
IsSigned: bool)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceMax(B: &Builder<'a>,
Src: &'a Value,
IsSigned: bool)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceFMin(B: &Builder<'a>,
Src: &'a Value,
IsNaN: bool)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildVectorReduceFMax(B: &Builder<'a>,
Src: &'a Value,
IsNaN: bool)
- -> Option<&'a Value>;
+ -> &'a Value;
pub fn LLVMRustBuildMinNum(
B: &Builder<'a>,
RunInliner: Bool);
pub fn LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
PMB: &PassManagerBuilder,
- PM: &PassManager) -> bool;
+ PM: &PassManager);
// Stuff that's in rustllvm/ because it's not upstream yet.