llvm-general-pure 3.4.2.2 → 3.4.3.0
raw patch · 8 files changed
+88/−11 lines, 8 filesdep ~llvm-general-pure
Dependency ranges changed: llvm-general-pure
Files
- llvm-general-pure.cabal +4/−4
- src/LLVM/General/AST.hs +1/−1
- src/LLVM/General/AST/Constant.hs +1/−1
- src/LLVM/General/AST/Instruction.hs +17/−0
- src/LLVM/General/AST/Operand.hs +2/−1
- src/LLVM/General/AST/Type.hs +57/−0
- src/LLVM/General/PrettyPrint.hs +1/−0
- test/LLVM/General/Test/PrettyPrint.hs +5/−4
llvm-general-pure.cabal view
@@ -1,5 +1,5 @@ name: llvm-general-pure-version: 3.4.2.2+version: 3.4.3.0 license: BSD3 license-file: LICENSE author: Benjamin S.Scarlet <fgthb0@greynode.net>@@ -15,7 +15,7 @@ It includes an ADT to represent LLVM IR (<http://llvm.org/docs/LangRef.html>). The llvm-general package builds on this one with FFI bindings to LLVM, but llvm-general-pure does not require LLVM to be available. .- For haddock, see <http://bscarlet.github.io/llvm-general/3.4.2.2/doc/html/llvm-general-pure/index.html>.+ For haddock, see <http://bscarlet.github.io/llvm-general/3.4.3.0/doc/html/llvm-general-pure/index.html>. source-repository head type: git@@ -25,7 +25,7 @@ type: git location: git://github.com/bscarlet/llvm-general.git branch: llvm-3.4- tag: v3.4.2.2+ tag: v3.4.3.0 library ghc-options: -fwarn-unused-imports@@ -80,7 +80,7 @@ HUnit >= 1.2.4.2, test-framework-quickcheck2 >= 0.3.0.1, QuickCheck >= 2.5.1.1,- llvm-general-pure == 3.4.2.2,+ llvm-general-pure == 3.4.3.0, containers >= 0.4.2.1, mtl >= 2.0.1.0 hs-source-dirs: test
src/LLVM/General/AST.hs view
@@ -19,7 +19,7 @@ import Data.Data import LLVM.General.AST.Name-import LLVM.General.AST.Type+import LLVM.General.AST.Type (Type(..), FloatingPointFormat(..)) import LLVM.General.AST.Global import LLVM.General.AST.Operand import LLVM.General.AST.Instruction
src/LLVM/General/AST/Constant.hs view
@@ -30,7 +30,7 @@ | Vector { memberValues :: [ Constant ] } | Undef { constantType :: Type } | BlockAddress { blockAddressFunction :: Name, blockAddressBlock :: Name }- | GlobalReference Name + | GlobalReference Type Name | Add { nsw :: Bool, nuw :: Bool,
src/LLVM/General/AST/Instruction.hs view
@@ -65,6 +65,18 @@ } deriving (Eq, Read, Show, Typeable, Data) +-- | <http://llvm.org/docs/LangRef.html#fast-math-flags>+data FastMathFlags + = NoFastMathFlags+ | UnsafeAlgebra+ | FastMathFlags {+ noNaNs :: Bool,+ noInfs :: Bool,+ noSignedZeros :: Bool,+ allowReciprocal :: Bool+ }+ deriving (Eq, Ord, Read, Show, Data, Typeable)+ -- | <http://llvm.org/docs/LangRef.html#atomic-memory-ordering-constraints> -- <http://llvm.org/docs/Atomics.html> data MemoryOrdering@@ -103,6 +115,7 @@ metadata :: InstructionMetadata } | FAdd {+ fastMathFlags :: FastMathFlags, operand0 :: Operand, operand1 :: Operand, metadata :: InstructionMetadata@@ -115,6 +128,7 @@ metadata :: InstructionMetadata } | FSub { + fastMathFlags :: FastMathFlags, operand0 :: Operand, operand1 :: Operand, metadata :: InstructionMetadata@@ -127,6 +141,7 @@ metadata :: InstructionMetadata } | FMul { + fastMathFlags :: FastMathFlags, operand0 :: Operand, operand1 :: Operand, metadata :: InstructionMetadata@@ -144,6 +159,7 @@ metadata :: InstructionMetadata } | FDiv { + fastMathFlags :: FastMathFlags, operand0 :: Operand, operand1 :: Operand, metadata :: InstructionMetadata@@ -159,6 +175,7 @@ metadata :: InstructionMetadata } | FRem { + fastMathFlags :: FastMathFlags, operand0 :: Operand, operand1 :: Operand, metadata :: InstructionMetadata
src/LLVM/General/AST/Operand.hs view
@@ -7,6 +7,7 @@ import LLVM.General.AST.Name import LLVM.General.AST.Constant import LLVM.General.AST.InlineAssembly+import LLVM.General.AST.Type -- | A 'MetadataNodeID' is a number for identifying a metadata node. -- Note this is different from "named metadata", which are represented with@@ -23,7 +24,7 @@ -- | An 'Operand' is roughly that which is an argument to an 'LLVM.General.AST.Instruction.Instruction' data Operand -- | %foo- = LocalReference Name+ = LocalReference Type Name -- | 'Constant's include 'LLVM.General.AST.Constant.GlobalReference', for \@foo | ConstantOperand Constant | MetadataStringOperand String
src/LLVM/General/AST/Type.hs view
@@ -39,3 +39,60 @@ -- | <http://llvm.org/docs/LangRef.html#metadata-type> | MetadataType -- only to be used as a parameter type for a few intrinsics deriving (Eq, Ord, Read, Show, Typeable, Data)++-- | An abbreviation for 'VoidType'+void :: Type+void = VoidType++-- | An abbreviation for 'IntegerType' 1+i1 :: Type+i1 = IntegerType 1++-- | An abbreviation for 'IntegerType' 8+i8 :: Type+i8 = IntegerType 8++-- | An abbreviation for 'IntegerType' 16+i16 :: Type+i16 = IntegerType 16++-- | An abbreviation for 'IntegerType' 32+i32 :: Type+i32 = IntegerType 32++-- | An abbreviation for 'IntegerType' 64+i64 :: Type+i64 = IntegerType 64++-- | An abbreviation for 'IntegerType' 128+i128 :: Type+i128 = IntegerType 128++-- | An abbreviation for 'PointerType' t ('AddrSpace' 0)+ptr :: Type -> Type+ptr t = PointerType t (AddrSpace 0)++-- | An abbreviation for 'FloatingPointType' 16 'IEEE'+half :: Type+half = FloatingPointType 16 IEEE++-- | An abbreviation for 'FloatingPointType' 32 'IEEE'+float :: Type+float = FloatingPointType 32 IEEE++-- | An abbreviation for 'FloatingPointType' 64 'IEEE'+double :: Type+double = FloatingPointType 64 IEEE++-- | An abbreviation for 'FloatingPointType' 128 'IEEE'+fp128 :: Type+fp128 = FloatingPointType 128 IEEE++-- | An abbreviation for 'FloatingPointType' 80 'DoubleExtended'+x86_fp80 :: Type+x86_fp80 = FloatingPointType 80 DoubleExtended++-- | An abbreviation for 'FloatingPointType' 128 'PairOfFloats'+ppc_fp128 :: Type+ppc_fp128 = FloatingPointType 128 PairOfFloats+
src/LLVM/General/PrettyPrint.hs view
@@ -72,6 +72,7 @@ ''A.RMWOperation, ''A.Atomicity, ''A.Dialect,+ ''A.FastMathFlags, ''A.MemoryOrdering, ''Either, ''Maybe
test/LLVM/General/Test/PrettyPrint.hs view
@@ -7,6 +7,7 @@ import LLVM.General.PrettyPrint import LLVM.General.AST+import LLVM.General.AST.Type import qualified LLVM.General.AST.Linkage as L import qualified LLVM.General.AST.Visibility as V import qualified LLVM.General.AST.CallingConvention as CC@@ -15,8 +16,8 @@ tests = testGroup "PrettyPrint" [ testCase "basic" $ do let ast = Module "<string>" Nothing Nothing [- GlobalDefinition $ Function L.External V.Default CC.C [] (IntegerType 32) (Name "foo") ([- Parameter (IntegerType 32) (Name "x") []+ GlobalDefinition $ Function L.External V.Default CC.C [] i32 (Name "foo") ([+ Parameter i32 (Name "x") [] ],False) [] Nothing 0 Nothing [@@ -33,7 +34,7 @@ ), BasicBlock (Name "here") [ ] (- Do $ Ret (Just (LocalReference (UnName 1))) []+ Do $ Ret (Just (LocalReference i32 (UnName 1))) [] ) ] ]@@ -65,7 +66,7 @@ \ }\n\ \ ] (A.Do A.Br { A.dest = A.Name \"here\", A.metadata' = [] }),\n\ \ A.G.BasicBlock (A.Name \"here\") [] (\n\- \ A.Do A.Ret {A.returnOperand = Just (A.LocalReference (A.UnName 1)), A.metadata' = []}\n\+ \ A.Do A.Ret {A.returnOperand = Just (A.LocalReference (A.IntegerType 32) (A.UnName 1)), A.metadata' = []}\n\ \ )\n\ \ ]\n\ \ }\n\