llvm 0.6.3.0 → 0.6.4.0
raw patch · 6 files changed
+26/−7 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ LLVM.Core: TDLabel :: TypeDesc
+ LLVM.Core: data Label
+ LLVM.Core: fromLabel :: Value Label -> BasicBlock
+ LLVM.Core: toLabel :: BasicBlock -> Value Label
- LLVM.FFI.Core: labelType :: IO TypeRef
+ LLVM.FFI.Core: labelType :: TypeRef
- LLVM.FFI.Core: opaqueType :: IO TypeRef
+ LLVM.FFI.Core: opaqueType :: TypeRef
Files
- LLVM/Core.hs +1/−0
- LLVM/Core/CodeGen.hs +7/−0
- LLVM/Core/Data.hs +4/−1
- LLVM/Core/Type.hs +11/−3
- LLVM/FFI/Core.hsc +2/−2
- llvm.cabal +1/−1
LLVM/Core.hs view
@@ -58,6 +58,7 @@ Linkage(..), -- * Basic blocks BasicBlock, newBasicBlock, newNamedBasicBlock, defineBasicBlock, createBasicBlock, getCurrentBasicBlock,+ fromLabel, toLabel, -- * Misc addAttributes, Attribute(..), castVarArgs,
LLVM/Core/CodeGen.hs view
@@ -22,6 +22,7 @@ constVector, constArray, -- * Basic blocks BasicBlock(..), newBasicBlock, newNamedBasicBlock, defineBasicBlock, createBasicBlock, getCurrentBasicBlock,+ fromLabel, toLabel, -- * Misc withCurrentBuilder ) where@@ -265,6 +266,12 @@ getCurrentBasicBlock = do bld <- getBuilder liftIO $ liftM BasicBlock $ U.getInsertBlock bld++toLabel :: BasicBlock -> Value Label+toLabel (BasicBlock ptr) = Value (FFI.basicBlockAsValue ptr)++fromLabel :: Value Label -> BasicBlock+fromLabel (Value ptr) = BasicBlock (FFI.valueAsBasicBlock ptr) --------------------------------------
LLVM/Core/Data.hs view
@@ -1,5 +1,6 @@+{-# LANGUAGE EmptyDataDecls #-} module LLVM.Core.Data(IntN(..), WordN(..), FP128(..),- Array(..), Vector(..), Ptr) where+ Array(..), Vector(..), Ptr, Label) where import Foreign.Ptr(Ptr) import Data.TypeLevel @@ -30,3 +31,5 @@ newtype Vector n a = Vector [a] deriving (Show) +-- |Label type, produced by a basic block.+data Label
LLVM/Core/Type.hs view
@@ -59,6 +59,7 @@ code (TDVector n a) = FFI.vectorType (code a) (fromInteger n) code (TDPtr a) = FFI.pointerType (code a) 0 code (TDFunction va as b) = functionType va (code b) (map code as)+ code TDLabel = FFI.labelType typeName :: (IsType a) => a -> String typeName = code . typeDesc@@ -75,7 +76,7 @@ -- |Type descriptor, used to convey type information through the LLVM API. data TypeDesc = TDFloat | TDDouble | TDFP128 | TDVoid | TDInt Bool Integer | TDArray Integer TypeDesc | TDVector Integer TypeDesc- | TDPtr TypeDesc | TDFunction Bool [TypeDesc] TypeDesc+ | TDPtr TypeDesc | TDFunction Bool [TypeDesc] TypeDesc | TDLabel deriving (Eq, Ord, Show) -- XXX isFloating and typeName could be extracted from typeRef@@ -146,6 +147,9 @@ -- Void type instance IsType () where typeDesc _ = TDVoid +-- Label type+instance IsType Label where typeDesc _ = TDLabel+ -- Variable size integer types instance (Pos n) => IsType (IntN n) where typeDesc _ = TDInt True (toNum (undefined :: n))@@ -235,6 +239,7 @@ instance IsFirstClass Word64 instance (IsPowerOf2 n, IsPrimitive a) => IsFirstClass (Vector n a) instance (IsType a) => IsFirstClass (Ptr a)+instance IsFirstClass Label instance IsFirstClass () -- XXX This isn't right, but () can be returned instance IsSized Float D32@@ -253,8 +258,11 @@ instance IsSized Word64 D64 instance (Nat n, IsSized a s, Mul n s ns, Pos ns) => IsSized (Array n a) ns instance (IsPowerOf2 n, IsPrimitive a, IsSized a s, Mul n s ns, Pos ns) => IsSized (Vector n a) ns-instance (IsType a, Pos s) => IsSized (Ptr a) s -- XXX+instance (IsType a) => IsSized (Ptr a) PtrSize+-- instance IsSized Label PtrSize -- labels are not quite first classed +type PtrSize = D32 -- XXX this is wrong!+ instance IsPrimitive Float instance IsPrimitive Double instance IsPrimitive FP128@@ -269,7 +277,7 @@ instance IsPrimitive Word16 instance IsPrimitive Word32 instance IsPrimitive Word64---instance IsPrimitive Label+instance IsPrimitive Label instance IsPrimitive () -- Functions.
LLVM/FFI/Core.hsc view
@@ -1137,9 +1137,9 @@ foreign import ccall unsafe "LLVMInitializeFunctionPassManager" initializeFunctionPassManager :: PassManagerRef -> IO CInt foreign import ccall unsafe "LLVMLabelType" labelType- :: IO TypeRef+ :: TypeRef foreign import ccall unsafe "LLVMOpaqueType" opaqueType- :: IO TypeRef+ :: TypeRef foreign import ccall unsafe "LLVMPositionBuilder" positionBuilder :: BuilderRef -> BasicBlockRef -> ValueRef -> IO () foreign import ccall unsafe "LLVMRunFunctionPassManager" runFunctionPassManager
llvm.cabal view
@@ -1,5 +1,5 @@ name: llvm-version: 0.6.3.0+version: 0.6.4.0 license: BSD3 license-file: LICENSE synopsis: Bindings to the LLVM compiler toolkit