Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
LLVM.Extra.Control
Description
Useful control structures additionally to those in LLVM.Util.Loop.
Synopsis
- arrayLoop :: (Phi a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr b) -> a -> (Value (Ptr b) -> a -> CodeGenFunction r a) -> CodeGenFunction r a
- arrayLoop2 :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r s) -> CodeGenFunction r s
- arrayLoopWithExit :: (Phi s, IsType a, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> s -> (Value (Ptr a) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s)
- arrayLoop2WithExit :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s)
- fixedLengthLoop :: (Phi s, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> s -> (s -> CodeGenFunction r s) -> CodeGenFunction r s
- whileLoop :: Phi a => a -> (a -> CodeGenFunction r (Value Bool)) -> (a -> CodeGenFunction r a) -> CodeGenFunction r a
- whileLoopShared :: Phi a => a -> (a -> (CodeGenFunction r (Value Bool), CodeGenFunction r a)) -> CodeGenFunction r a
- loopWithExit :: Phi a => a -> (a -> CodeGenFunction r (Value Bool, b)) -> (b -> CodeGenFunction r a) -> CodeGenFunction r b
- ifThenElse :: Phi a => Value Bool -> CodeGenFunction r a -> CodeGenFunction r a -> CodeGenFunction r a
- ifThen :: Phi a => Value Bool -> a -> CodeGenFunction r a -> CodeGenFunction r a
- class Phi a => Select a where
- select :: Value Bool -> a -> a -> CodeGenFunction r a
- selectTraversable :: (Select a, Traversable f, Applicative f) => Value Bool -> f a -> f a -> CodeGenFunction r (f a)
- ifThenSelect :: Select a => Value Bool -> a -> CodeGenFunction r a -> CodeGenFunction r a
- ret :: Value a -> CodeGenFunction a ()
- retVoid :: CodeGenFunction () ()
Documentation
arrayLoop :: (Phi a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr b) -> a -> (Value (Ptr b) -> a -> CodeGenFunction r a) -> CodeGenFunction r a Source #
arrayLoop2 :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r s) -> CodeGenFunction r s Source #
arrayLoopWithExit :: (Phi s, IsType a, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> s -> (Value (Ptr a) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s) Source #
arrayLoop2WithExit :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s) Source #
fixedLengthLoop :: (Phi s, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> s -> (s -> CodeGenFunction r s) -> CodeGenFunction r s Source #
whileLoop :: Phi a => a -> (a -> CodeGenFunction r (Value Bool)) -> (a -> CodeGenFunction r a) -> CodeGenFunction r a Source #
whileLoopShared :: Phi a => a -> (a -> (CodeGenFunction r (Value Bool), CodeGenFunction r a)) -> CodeGenFunction r a Source #
This is a variant of whileLoop
that may be more convient,
because you only need one lambda expression
for both loop condition and loop body.
loopWithExit :: Phi a => a -> (a -> CodeGenFunction r (Value Bool, b)) -> (b -> CodeGenFunction r a) -> CodeGenFunction r b Source #
This is a loop with a single point for exit from within the loop.
The Bool
value indicates whether the loop shall be continued.
ifThenElse :: Phi a => Value Bool -> CodeGenFunction r a -> CodeGenFunction r a -> CodeGenFunction r a Source #
This construct starts new blocks,
so be prepared when continueing after an ifThenElse
.
ifThen :: Phi a => Value Bool -> a -> CodeGenFunction r a -> CodeGenFunction r a Source #
class Phi a => Select a where Source #
Instances
Select () Source # | |
Defined in LLVM.Extra.Control | |
Select a => Select (T a) Source # | |
Defined in LLVM.Extra.Multi.Value.Private | |
(CmpRet a, IsPrimitive a) => Select (Value a) Source # | |
Defined in LLVM.Extra.Control | |
(Select a, Select b) => Select (a, b) Source # | |
Defined in LLVM.Extra.Control | |
(Select a, Select b, Select c) => Select (a, b, c) Source # | |
Defined in LLVM.Extra.Control |
selectTraversable :: (Select a, Traversable f, Applicative f) => Value Bool -> f a -> f a -> CodeGenFunction r (f a) Source #
ifThenSelect :: Select a => Value Bool -> a -> CodeGenFunction r a -> CodeGenFunction r a Source #
ret :: Value a -> CodeGenFunction a () Source #
ret
terminates a basic block which interferes badly
with other control structures in this module.
If you use the control structures then better use LLVM.Extra.Function.
retVoid :: CodeGenFunction () () Source #