IntSLE = 41,
}
-impl traits::IntPredicateMethods for IntPredicate {
- fn convert_to_backend_specific(intpre: traits::IntPredicate) -> Self {
+impl IntPredicate {
+ pub fn from_generic(intpre: traits::IntPredicate) -> Self {
match intpre {
traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
traits::IntPredicate::IntNE => IntPredicate::IntNE,
RealPredicateTrue = 15,
}
-impl traits::RealPredicateMethods for RealPredicate {
- fn convert_to_backend_specific(realpred: traits::RealPredicate) -> Self {
+impl RealPredicate {
+ pub fn from_generic(realpred: traits::RealPredicate) -> Self {
match realpred {
traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
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)]