llvm-hs-pure 5.1.1 → 5.1.2
raw patch · 4 files changed
+33/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ LLVM.IRBuilder.Instruction: extractElement :: MonadIRBuilder m => Operand -> Operand -> m Operand
+ LLVM.IRBuilder.Instruction: extractValue :: MonadIRBuilder m => Operand -> [Word32] -> m Operand
+ LLVM.IRBuilder.Instruction: fpext :: MonadIRBuilder m => Operand -> Type -> m Operand
+ LLVM.IRBuilder.Instruction: fptrunc :: MonadIRBuilder m => Operand -> Type -> m Operand
+ LLVM.IRBuilder.Instruction: insertElement :: MonadIRBuilder m => Operand -> Operand -> Operand -> m Operand
+ LLVM.IRBuilder.Instruction: insertValue :: MonadIRBuilder m => Operand -> Operand -> [Word32] -> m Operand
+ LLVM.IRBuilder.Instruction: shuffleVector :: MonadIRBuilder m => Operand -> Operand -> Constant -> m Operand
Files
- CHANGELOG.md +8/−1
- llvm-hs-pure.cabal +1/−1
- src/LLVM/AST/Typed.hs +1/−1
- src/LLVM/IRBuilder/Instruction.hs +23/−2
CHANGELOG.md view
@@ -1,4 +1,11 @@-## 5.1.1 (2017-12-26)+## 5.1.2 (2018-01-06)++* Fixes and enhancements to the IRBuilder+ * `sdiv` and `udiv` no longer default to exact.+ * Fix type of global references.+ * Add more instructions.++## 5.1.1 (2017-12-16) * Add a completely new API for building modules in a monadic style similar to the IRBuilder provided by LLVM’s C++ API. The modules can be found in `LLVM.IRBuilder`. An example can be found in the readme and in the test suite. * Add an API for getting the type of LLVM values in
llvm-hs-pure.cabal view
@@ -1,5 +1,5 @@ name: llvm-hs-pure-version: 5.1.1+version: 5.1.2 license: BSD3 license-file: LICENSE author: Anthony Cowley, Stephen Diehl, Moritz Kiefer <moritz.kiefer@purelyfunctional.org>, Benjamin S. Scarlet
src/LLVM/AST/Typed.hs view
@@ -41,7 +41,7 @@ (x:_) -> typeOf x typeOf (C.Undef t) = t typeOf (C.BlockAddress {..}) = ptr i8- typeOf (C.GlobalReference t _) = t+ typeOf (C.GlobalReference t _) = ptr t typeOf (C.Add {..}) = typeOf operand0 typeOf (C.FAdd {..}) = typeOf operand0 typeOf (C.FDiv {..}) = typeOf operand0
src/LLVM/IRBuilder/Instruction.hs view
@@ -43,10 +43,10 @@ sub a b = emitInstr (typeOf a) $ Sub False False a b [] udiv :: MonadIRBuilder m => Operand -> Operand -> m Operand-udiv a b = emitInstr (typeOf a) $ UDiv True a b []+udiv a b = emitInstr (typeOf a) $ UDiv False a b [] sdiv :: MonadIRBuilder m => Operand -> Operand -> m Operand-sdiv a b = emitInstr (typeOf a) $ SDiv True a b []+sdiv a b = emitInstr (typeOf a) $ SDiv False a b [] urem :: MonadIRBuilder m => Operand -> Operand -> m Operand urem a b = emitInstr (typeOf a) $ URem a b []@@ -99,6 +99,9 @@ trunc :: MonadIRBuilder m => Operand -> Type -> m Operand trunc a to = emitInstr to $ Trunc a to [] +fptrunc :: MonadIRBuilder m => Operand -> Type -> m Operand+fptrunc a to = emitInstr to $ FPTrunc a to []+ zext :: MonadIRBuilder m => Operand -> Type -> m Operand zext a to = emitInstr to $ ZExt a to [] @@ -111,6 +114,9 @@ fptosi :: MonadIRBuilder m => Operand -> Type -> m Operand fptosi a to = emitInstr to $ FPToSI a to [] +fpext :: MonadIRBuilder m => Operand -> Type -> m Operand+fpext a to = emitInstr to $ FPExt a to []+ uitofp :: MonadIRBuilder m => Operand -> Type -> m Operand uitofp a to = emitInstr to $ UIToFP a to [] @@ -125,6 +131,21 @@ bitcast :: MonadIRBuilder m => Operand -> Type -> m Operand bitcast a to = emitInstr to $ BitCast a to []++extractElement :: MonadIRBuilder m => Operand -> Operand -> m Operand+extractElement v i = emitInstr (typeOf v) $ ExtractElement v i []++insertElement :: MonadIRBuilder m => Operand -> Operand -> Operand -> m Operand+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 []++extractValue :: MonadIRBuilder m => Operand -> [Word32] -> m Operand+extractValue a i = emitInstr (typeOf a) $ ExtractValue a i []++insertValue :: MonadIRBuilder m => Operand -> Operand -> [Word32] -> m Operand+insertValue a e i = emitInstr (typeOf a) $ InsertValue a e i [] icmp :: MonadIRBuilder m => IP.IntegerPredicate -> Operand -> Operand -> m Operand icmp pred a b = emitInstr i1 $ ICmp pred a b []