Safe Haskell | None |
---|
- class (Phi llvmValue, Undefined llvmValue, IsType (Struct llvmValue), IsSized (Struct llvmValue)) => C llvmValue where
- type Struct llvmValue :: *
- load :: Value (Ptr (Struct llvmValue)) -> CodeGenFunction r llvmValue
- store :: llvmValue -> Value (Ptr (Struct llvmValue)) -> CodeGenFunction r ()
- decompose :: Value (Struct llvmValue) -> CodeGenFunction r llvmValue
- compose :: llvmValue -> CodeGenFunction r (Value (Struct llvmValue))
- modify :: C llvmValue => (llvmValue -> CodeGenFunction r llvmValue) -> Value (Ptr (Struct llvmValue)) -> CodeGenFunction r ()
- type Record r o v = Element r o v v
- data Element r o v x
- element :: (C x, GetValue o n, ValueType o n ~ Struct x, GetElementPtr o (n, ()), ElementPtrType o (n, ()) ~ Struct x) => (v -> x) -> n -> Element r o v x
- loadRecord :: Record r o llvmValue -> Value (Ptr o) -> CodeGenFunction r llvmValue
- storeRecord :: Record r o llvmValue -> llvmValue -> Value (Ptr o) -> CodeGenFunction r ()
- decomposeRecord :: Record r o llvmValue -> Value o -> CodeGenFunction r llvmValue
- composeRecord :: IsType o => Record r o llvmValue -> llvmValue -> CodeGenFunction r (Value o)
- loadNewtype :: C a => (a -> llvmValue) -> Value (Ptr (Struct a)) -> CodeGenFunction r llvmValue
- storeNewtype :: C a => (llvmValue -> a) -> llvmValue -> Value (Ptr (Struct a)) -> CodeGenFunction r ()
- decomposeNewtype :: C a => (a -> llvmValue) -> Value (Struct a) -> CodeGenFunction r llvmValue
- composeNewtype :: C a => (llvmValue -> a) -> llvmValue -> CodeGenFunction r (Value (Struct a))
Documentation
class (Phi llvmValue, Undefined llvmValue, IsType (Struct llvmValue), IsSized (Struct llvmValue)) => C llvmValue whereSource
An implementation of both Value
and C
must ensure that haskellValue
is compatible
with Stored (Struct haskellValue)
(which we want to call llvmStruct
).
That is, writing and reading llvmStruct
by LLVM
must be the same as accessing haskellValue
by Storable
methods.
ToDo: In future we may also require Storable constraint for llvmStruct
.
We use a functional dependency in order to let type inference work nicely.
load :: Value (Ptr (Struct llvmValue)) -> CodeGenFunction r llvmValueSource
store :: llvmValue -> Value (Ptr (Struct llvmValue)) -> CodeGenFunction r ()Source
decompose :: Value (Struct llvmValue) -> CodeGenFunction r llvmValueSource
compose :: llvmValue -> CodeGenFunction r (Value (Struct llvmValue))Source
C () | |
(IsSized a, IsFirstClass a) => C (Value a) | |
C a => C (T a) | |
C a => C (T a) | |
(C a, C (ValueOf a)) => C (T a) | |
(C a, C b) => C (a, b) | |
(Natural n, C a, Natural (FromUnary n), Natural (:*: (FromUnary n) (SizeOf (Struct a))), IsFirstClass (Struct a)) => C (T n a) | |
(C a, C b) => C (T a b) | |
(Positive n, C a, C (VectorValueOf n a)) => C (T n a) | |
(C a, C b, C c) => C (a, b, c) | |
(C a, C b, C c, C d) => C (a, b, c, d) |
modify :: C llvmValue => (llvmValue -> CodeGenFunction r llvmValue) -> Value (Ptr (Struct llvmValue)) -> CodeGenFunction r ()Source
element :: (C x, GetValue o n, ValueType o n ~ Struct x, GetElementPtr o (n, ()), ElementPtrType o (n, ()) ~ Struct x) => (v -> x) -> n -> Element r o v xSource
loadRecord :: Record r o llvmValue -> Value (Ptr o) -> CodeGenFunction r llvmValueSource
storeRecord :: Record r o llvmValue -> llvmValue -> Value (Ptr o) -> CodeGenFunction r ()Source
decomposeRecord :: Record r o llvmValue -> Value o -> CodeGenFunction r llvmValueSource
composeRecord :: IsType o => Record r o llvmValue -> llvmValue -> CodeGenFunction r (Value o)Source
loadNewtype :: C a => (a -> llvmValue) -> Value (Ptr (Struct a)) -> CodeGenFunction r llvmValueSource
storeNewtype :: C a => (llvmValue -> a) -> llvmValue -> Value (Ptr (Struct a)) -> CodeGenFunction r ()Source
decomposeNewtype :: C a => (a -> llvmValue) -> Value (Struct a) -> CodeGenFunction r llvmValueSource
composeNewtype :: C a => (llvmValue -> a) -> llvmValue -> CodeGenFunction r (Value (Struct a))Source