{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_HADDOCK hide #-}
module LLVM.AST.Type.Instruction.Atomic
where
import LLVM.AST.Type.Downcast
import qualified LLVM.AST.Instruction as LLVM
data MemoryOrdering
= Unordered
| Monotonic
| Acquire
| Release
| AcquireRelease
| SequentiallyConsistent
data Synchronisation
= SingleThread
| CrossThread
type Atomicity = (Synchronisation, MemoryOrdering)
instance Downcast MemoryOrdering LLVM.MemoryOrdering where
downcast :: MemoryOrdering -> MemoryOrdering
downcast MemoryOrdering
Unordered = MemoryOrdering
LLVM.Unordered
downcast MemoryOrdering
Monotonic = MemoryOrdering
LLVM.Monotonic
downcast MemoryOrdering
Acquire = MemoryOrdering
LLVM.Acquire
downcast MemoryOrdering
Release = MemoryOrdering
LLVM.Release
downcast MemoryOrdering
AcquireRelease = MemoryOrdering
LLVM.AcquireRelease
downcast MemoryOrdering
SequentiallyConsistent = MemoryOrdering
LLVM.SequentiallyConsistent
instance Downcast Synchronisation LLVM.SynchronizationScope where
downcast :: Synchronisation -> SynchronizationScope
downcast Synchronisation
SingleThread = SynchronizationScope
LLVM.SingleThread
#if MIN_VERSION_llvm_hs_pure(5,0,0)
downcast Synchronisation
CrossThread = SynchronizationScope
LLVM.System
#else
downcast CrossThread = LLVM.CrossThread
#endif