llvm-hs-pure 6.2.0 → 6.2.1
raw patch · 4 files changed
+31/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- llvm-hs-pure.cabal +1/−1
- src/LLVM/AST.hs +20/−0
- src/LLVM/IRBuilder/Instruction.hs +6/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 6.2.1 (2018-06-12)++* Fix type of `shuffleVector` in the IRBuilder API.+ ## 6.2.0 (2018-05-08) * Remove field prefixes from `DIDerivedType`, `DIBasicType` and
llvm-hs-pure.cabal view
@@ -1,5 +1,5 @@ name: llvm-hs-pure-version: 6.2.0+version: 6.2.1 license: BSD3 license-file: LICENSE author: Anthony Cowley, Stephen Diehl, Moritz Kiefer <moritz.kiefer@purelyfunctional.org>, Benjamin S. Scarlet
src/LLVM/AST.hs view
@@ -21,6 +21,11 @@ module LLVM.AST.Instruction, module LLVM.AST.Name, module LLVM.AST.Type+ -- * Overview+ -- $overview++ -- * Constructing the AST for an LLVM module+ -- $moduleconstruction ) where import LLVM.Prelude@@ -33,6 +38,21 @@ import LLVM.AST.DataLayout import qualified LLVM.AST.Attribute as A import qualified LLVM.AST.COMDAT as COMDAT++{- $overview++@llvm-hs-pure@ defines the Haskell AST for representing an LLVM+`Module`. For interacting with the LLVM C/C++ libraries and an+overview of the various libraries in the @llvm-hs@ ecosystem, take a+look at the docs in the @LLVM@ module in @llvm-hs@.++In addition to constructing the LLVM AST manually, there is also a+monadic IRBuilder interface in `LLVM.IRBuilder`. The IRBuilder will+take care of generating fresh names automatically and generally+reduces the verbosity of using the AST directly. Using+@RecursiveDo/mdo@, it is also capable of handling forward references+automatically.+-} -- | Any thing which can be at the top level of a 'Module' data Definition
src/LLVM/IRBuilder/Instruction.hs view
@@ -143,7 +143,12 @@ insertElement v e i = emitInstr (typeOf v) $ InsertElement v e i [] shuffleVector :: MonadIRBuilder m => Operand -> Operand -> C.Constant -> m Operand-shuffleVector a b m = emitInstr (typeOf a) $ ShuffleVector a b m []+shuffleVector a b m = emitInstr retType $ ShuffleVector a b m []+ where retType =+ case (typeOf a, typeOf m) of+ (VectorType _ elemTyp, VectorType maskLength _) -> VectorType maskLength elemTyp+ _ -> error "shuffleVector: Expected two vectors and a vector mask"+ extractValue :: MonadIRBuilder m => Operand -> [Word32] -> m Operand extractValue a i = emitInstr (extractValueType i (typeOf a)) $ ExtractValue a i []