]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/traits.rs
Generalized SynchronisationScope for BuilderMethods
[rust.git] / src / librustc_codegen_llvm / traits.rs
index e23eeac1c29a816f5c0a8c437afe8560252f40e9..d28dd0fa795a5f6a11e4fcedb0dc10ebb464f42e 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
+use llvm::AsmDialect;
 use common::*;
 use type_::Type;
 use libc::c_char;
@@ -30,7 +30,7 @@ impl OperandBundleDef<'ll, &'ll Value> {
     pub fn new(name: &'ll str, val: &'ll Value) -> Self {
         OperandBundleDef {
             name,
-            val,
+            val
         }
     }
 }
@@ -45,7 +45,7 @@ pub enum IntPredicate {
     IntSGT,
     IntSGE,
     IntSLT,
-    IntSLE,
+    IntSLE
 }
 
 #[allow(dead_code)]
@@ -65,9 +65,44 @@ pub enum RealPredicate {
     RealULT,
     RealULE,
     RealUNE,
-    RealPredicateTrue,
+    RealPredicateTrue
 }
 
+pub enum AtomicRmwBinOp {
+    AtomicXchg,
+    AtomicAdd,
+    AtomicSub,
+    AtomicAnd,
+    AtomicNand,
+    AtomicOr,
+    AtomicXor,
+    AtomicMax,
+    AtomicMin,
+    AtomicUMax,
+    AtomicUMin
+}
+
+pub enum AtomicOrdering {
+    #[allow(dead_code)]
+    NotAtomic,
+    Unordered,
+    Monotonic,
+    // Consume,  // Not specified yet.
+    Acquire,
+    Release,
+    AcquireRelease,
+    SequentiallyConsistent,
+}
+
+pub enum SynchronizationScope {
+    // FIXME: figure out if this variant is needed at all.
+    #[allow(dead_code)]
+    Other,
+    SingleThread,
+    CrossThread,
+}
+
+
 pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll,
     Value : ?Sized,
     BasicBlock: ?Sized