llvm 3.0.0.0 → 3.0.1.0
raw patch · 5 files changed
+54/−32 lines, 5 filesdep ~llvm-basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: llvm-base
API changes (from Hackage documentation)
- LLVM.Core: unwind :: CodeGenFunction r Terminate
+ LLVM.Core: class StructFields as
- LLVM.Core: bitcast :: (IsFirstClass a, IsFirstClass b, IsSized a sa, IsSized b sb, :==: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: bitcast :: (IsFirstClass a, IsFirstClass b, IsSized a sa, IsSized b sb, sa :==: sb) => Value a -> CodeGenFunction r (Value b)
- LLVM.Core: fpext :: (IsFloating a, IsFloating b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, :<: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: fpext :: (IsFloating a, IsFloating b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, sa :<: sb) => Value a -> CodeGenFunction r (Value b)
- LLVM.Core: fptrunc :: (IsFloating a, IsFloating b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, :>: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: fptrunc :: (IsFloating a, IsFloating b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, sa :>: sb) => Value a -> CodeGenFunction r (Value b)
- LLVM.Core: sext :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, :<: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: sext :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, sa :<: sb) => Value a -> CodeGenFunction r (Value b)
- LLVM.Core: trunc :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, :>: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: trunc :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, sa :>: sb) => Value a -> CodeGenFunction r (Value b)
- LLVM.Core: withString :: String -> (forall n. Nat n => Global (Array n Word8) -> CodeGenModule a) -> CodeGenModule a
+ LLVM.Core: withString :: WithString a => String -> (forall n. Nat n => Global (Array n Word8) -> a) -> a
- LLVM.Core: withStringNul :: String -> (forall n. Nat n => Global (Array n Word8) -> CodeGenModule a) -> CodeGenModule a
+ LLVM.Core: withStringNul :: WithString a => String -> (forall n. Nat n => Global (Array n Word8) -> a) -> a
- LLVM.Core: zext :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, :<: sa sb) => Value a -> CodeGenFunction r (Value b)
+ LLVM.Core: zext :: (IsInteger a, IsInteger b, IsPrimitive a, IsPrimitive b, IsSized a sa, IsSized b sb, sa :<: sb) => Value a -> CodeGenFunction r (Value b)
Files
- LLVM/Core/CodeGen.hs +36/−20
- LLVM/Core/Instructions.hs +7/−5
- LLVM/Core/Type.hs +2/−0
- LLVM/Core/Util.hs +7/−5
- llvm.cabal +2/−2
LLVM/Core/CodeGen.hs view
@@ -281,6 +281,8 @@ instance FunctionArgs (IO ()) (FA ()) () where apArgs _ _ g = g instance (Pos n, IsPrimitive a) => FunctionArgs (IO (Vector n a)) (FA (Vector n a)) (Vector n a) where apArgs _ _ g = g+instance StructFields as =>+ FunctionArgs (IO (Struct as)) (FA (Struct as)) (Struct as) where apArgs _ _ g = g instance (IsType a) => FunctionArgs (IO (Ptr a)) (FA (Ptr a)) (Ptr a) where apArgs _ _ g = g instance FunctionArgs (IO (StablePtr a)) (FA (StablePtr a)) (StablePtr a) where apArgs _ _ g = g@@ -439,31 +441,45 @@ -- Special string creators {-# DEPRECATED createString "use withString instead" #-} createString :: String -> TGlobal (Array n Word8)-createString s = string (length s) (U.constString s)+createString s =+ let (cstr, n) = U.constString s+ in string n cstr {-# DEPRECATED createStringNul "use withStringNul instead" #-} createStringNul :: String -> TGlobal (Array n Word8)-createStringNul s = string (length s + 1) (U.constStringNul s)+createStringNul s =+ let (cstr, n) = U.constStringNul s+ in string n cstr -withString ::- String ->- (forall n. (Nat n) => Global (Array n Word8) -> CodeGenModule a) ->- CodeGenModule a-withString s act =- let n = length s- in reifyIntegral n (\tn ->- do arr <- string n (U.constString s)- act (fixArraySize tn arr))+class WithString a where+ withString :: String -> (forall n . Nat n => Global (Array n Word8) -> a) -> a+ withStringNul :: String -> (forall n . Nat n => Global (Array n Word8) -> a) -> a -withStringNul ::- String ->- (forall n. (Nat n) => Global (Array n Word8) -> CodeGenModule a) ->- CodeGenModule a-withStringNul s act =- let n = length s + 1- in reifyIntegral n (\tn ->- do arr <- string n (U.constStringNul s)- act (fixArraySize tn arr))+instance WithString (CodeGenModule a) where+ withString s act =+ let (cstr, n) = U.constString s+ in reifyIntegral n (\tn ->+ do arr <- string n cstr+ act (fixArraySize tn arr))++ withStringNul s act =+ let (cstr, n) = U.constStringNul s+ in reifyIntegral n (\tn ->+ do arr <- string n cstr+ act (fixArraySize tn arr))++instance WithString (CodeGenFunction r b) where+ withString s act =+ let (cstr, n) = U.constString s+ in reifyIntegral n (\tn ->+ do arr <- liftCodeGenModule $ string n cstr+ act (fixArraySize tn arr))++ withStringNul s act =+ let (cstr, n) = U.constStringNul s+ in reifyIntegral n (\tn ->+ do arr <- liftCodeGenModule $ string n cstr+ act (fixArraySize tn arr)) fixArraySize :: n -> Global (Array n a) -> Global (Array n a) fixArraySize _ = id
LLVM/Core/Instructions.hs view
@@ -8,7 +8,8 @@ br, switch, invoke, invokeWithConv,- unwind,+ -- Removed in LLVM_3.0+ -- unwind, unreachable, -- * Arithmetic binary operations -- | Arithmetic operations with the normal semantics.@@ -276,12 +277,13 @@ -------------------------------------- +-- Removed in LLVM_3.0 -- |Unwind the call stack until a function call performed with 'invoke' is reached. -- I.e., throw a non-local exception.-unwind :: CodeGenFunction r Terminate-unwind = do- withCurrentBuilder_ FFI.buildUnwind- return terminate+-- unwind :: CodeGenFunction r Terminate+-- unwind = do+-- withCurrentBuilder_ FFI.buildUnwind+-- return terminate -- |Inform the code generator that this code can never be reached. unreachable :: CodeGenFunction r Terminate
LLVM/Core/Type.hs view
@@ -10,6 +10,8 @@ module LLVM.Core.Type( -- * Type classifier IsType(..),+ -- * StructFields classifier+ StructFields, -- ** Special type classifiers Nat, Pos,
LLVM/Core/Util.hs view
@@ -271,16 +271,18 @@ return v -- unsafePerformIO is safe because it's only used for the withCStringLen conversion-constStringInternal :: Bool -> String -> Value+constStringInternal :: Bool -> String -> (Value, Int) constStringInternal nulTerm s = unsafePerformIO $ withCStringLen s $ \(sPtr, sLen) ->- return $ FFI.constString sPtr (fromIntegral sLen) (fromBool (not nulTerm))+ return (FFI.constString sPtr (fromIntegral sLen) (fromBool (not nulTerm)), sLen) -constString :: String -> Value+constString :: String -> (Value, Int) constString = constStringInternal False -constStringNul :: String -> Value-constStringNul = constStringInternal True+constStringNul :: String -> (Value, Int)+constStringNul str =+ let (cstr, n) = constStringInternal True str+ in (cstr, n+1) --------------------------------------
llvm.cabal view
@@ -1,5 +1,5 @@ name: llvm-version: 3.0.0.0+version: 3.0.1.0 license: BSD3 license-file: LICENSE synopsis: Bindings to the LLVM compiler toolkit.@@ -42,7 +42,7 @@ base >= 3 && < 5, bytestring >= 0.9, directory,- llvm-base == 3.0.*,+ llvm-base >= 3.0.0.1 && < 4, mtl, process, type-level,