Copyright | (c) Galois Inc 2015-2016 |
---|---|
License | BSD3 |
Maintainer | rdockins@galois.com |
Stability | provisional |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Syntax extension definitions for LLVM
Synopsis
- data LLVMArch
- type X86 = 'X86
- type family ArchWidth (arch :: LLVMArch) :: Nat where ...
- data ArchRepr (arch :: LLVMArch) where
- data LLVMSideCondition (f :: CrucibleType -> Type) = LLVMSideCondition (f BoolType) (UndefinedBehavior f)
- data LLVMExtensionExpr :: (CrucibleType -> Type) -> CrucibleType -> Type where
- X86Expr :: !(ExtX86 f t) -> LLVMExtensionExpr f t
- LLVM_SideConditions :: !(GlobalVar Mem) -> !(TypeRepr tp) -> !(NonEmpty (LLVMSideCondition f)) -> !(f tp) -> LLVMExtensionExpr f tp
- LLVM_PointerExpr :: 1 <= w => !(NatRepr w) -> !(f NatType) -> !(f (BVType w)) -> LLVMExtensionExpr f (LLVMPointerType w)
- LLVM_PointerBlock :: 1 <= w => !(NatRepr w) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f NatType
- LLVM_PointerOffset :: 1 <= w => !(NatRepr w) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f (BVType w)
- LLVM_PointerIte :: 1 <= w => !(NatRepr w) -> !(f BoolType) -> !(f (LLVMPointerType w)) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f (LLVMPointerType w)
- data LLVMStmt (f :: CrucibleType -> Type) :: CrucibleType -> Type where
- LLVM_PushFrame :: !Text -> !(GlobalVar Mem) -> LLVMStmt f UnitType
- LLVM_PopFrame :: !(GlobalVar Mem) -> LLVMStmt f UnitType
- LLVM_Alloca :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (BVType wptr)) -> !Alignment -> !String -> LLVMStmt f (LLVMPointerType wptr)
- LLVM_Load :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(TypeRepr tp) -> !StorageType -> !Alignment -> LLVMStmt f tp
- LLVM_Store :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(TypeRepr tp) -> !StorageType -> !Alignment -> !(f tp) -> LLVMStmt f UnitType
- LLVM_MemClear :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !Bytes -> LLVMStmt f UnitType
- LLVM_LoadHandle :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(Maybe Type) -> !(f (LLVMPointerType wptr)) -> !(CtxRepr args) -> !(TypeRepr ret) -> LLVMStmt f (FunctionHandleType args ret)
- LLVM_ResolveGlobal :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> GlobalSymbol -> LLVMStmt f (LLVMPointerType wptr)
- LLVM_PtrEq :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f BoolType
- LLVM_PtrLe :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f BoolType
- LLVM_PtrAddOffset :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (BVType wptr)) -> LLVMStmt f (LLVMPointerType wptr)
- LLVM_PtrSubtract :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f (BVType wptr)
- LLVM_Debug :: !(LLVM_Dbg f c) -> LLVMStmt f UnitType
- data LLVM_Dbg f c where
- LLVM_Dbg_Addr :: HasPtrWidth wptr => !(f (LLVMPointerType wptr)) -> DILocalVariable -> DIExpression -> LLVM_Dbg f (LLVMPointerType wptr)
- LLVM_Dbg_Declare :: HasPtrWidth wptr => !(f (LLVMPointerType wptr)) -> DILocalVariable -> DIExpression -> LLVM_Dbg f (LLVMPointerType wptr)
- LLVM_Dbg_Value :: !(TypeRepr c) -> !(f c) -> DILocalVariable -> DIExpression -> LLVM_Dbg f c
- traverseConds :: Applicative m => (forall s. f s -> m (g s)) -> NonEmpty (LLVMSideCondition f) -> m (NonEmpty (LLVMSideCondition g))
- ppGlobalVar :: GlobalVar Mem -> Doc ann
- ppAlignment :: Alignment -> Doc ann
- data LLVM
Documentation
Data kind for representing LLVM architectures. Currently only X86 variants are supported.
Instances
Generic LLVMArch Source # | |
TestEquality ArchRepr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Arch | |
TestEquality ModuleTranslation Source # | |
Defined in Lang.Crucible.LLVM.Translation testEquality :: forall (a :: k) (b :: k). ModuleTranslation a -> ModuleTranslation b -> Maybe (a :~: b) # | |
OrdF ArchRepr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Arch compareF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> OrderingF x y # leqF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # ltF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # geqF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # gtF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # | |
type Rep LLVMArch Source # | |
Defined in Lang.Crucible.LLVM.Extension.Arch |
type family ArchWidth (arch :: LLVMArch) :: Nat where ... Source #
Type family defining the native machine word size for a given architecture.
data ArchRepr (arch :: LLVMArch) where Source #
Runtime representation of architectures.
Instances
TestEquality ArchRepr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Arch | |
OrdF ArchRepr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Arch compareF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> OrderingF x y # leqF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # ltF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # geqF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # gtF :: forall (x :: k) (y :: k). ArchRepr x -> ArchRepr y -> Bool # |
data LLVMSideCondition (f :: CrucibleType -> Type) Source #
Instances
data LLVMExtensionExpr :: (CrucibleType -> Type) -> CrucibleType -> Type where Source #
X86Expr :: !(ExtX86 f t) -> LLVMExtensionExpr f t | |
LLVM_SideConditions :: !(GlobalVar Mem) -> !(TypeRepr tp) -> !(NonEmpty (LLVMSideCondition f)) -> !(f tp) -> LLVMExtensionExpr f tp | |
LLVM_PointerExpr :: 1 <= w => !(NatRepr w) -> !(f NatType) -> !(f (BVType w)) -> LLVMExtensionExpr f (LLVMPointerType w) | |
LLVM_PointerBlock :: 1 <= w => !(NatRepr w) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f NatType | |
LLVM_PointerOffset :: 1 <= w => !(NatRepr w) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f (BVType w) | |
LLVM_PointerIte :: 1 <= w => !(NatRepr w) -> !(f BoolType) -> !(f (LLVMPointerType w)) -> !(f (LLVMPointerType w)) -> LLVMExtensionExpr f (LLVMPointerType w) |
Instances
TypeApp LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax appType :: forall (f :: CrucibleType -> Type) (x :: CrucibleType). LLVMExtensionExpr f x -> TypeRepr x # | |
PrettyApp LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax ppApp :: (forall (x :: k). f x -> Doc ann) -> forall (x :: k). LLVMExtensionExpr f x -> Doc ann # | |
FoldableFC LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax foldMapFC :: forall f m. Monoid m => (forall (x :: k). f x -> m) -> forall (x :: l). LLVMExtensionExpr f x -> m # foldrFC :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVMExtensionExpr f x -> b # foldlFC :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVMExtensionExpr f x -> b # foldrFC' :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVMExtensionExpr f x -> b # foldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVMExtensionExpr f x -> b # toListFC :: (forall (x :: k). f x -> a) -> forall (x :: l). LLVMExtensionExpr f x -> [a] # | |
FunctorFC LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax fmapFC :: (forall (x :: k). f x -> g x) -> forall (x :: l). LLVMExtensionExpr f x -> LLVMExtensionExpr g x # | |
OrdFC LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax compareFC :: (forall (x :: k) (y :: k). f x -> f y -> OrderingF x y) -> forall (x :: l) (y :: l). LLVMExtensionExpr f x -> LLVMExtensionExpr f y -> OrderingF x y # | |
TestEqualityFC LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax testEqualityFC :: (forall (x :: k) (y :: k). f x -> f y -> Maybe (x :~: y)) -> forall (x :: l) (y :: l). LLVMExtensionExpr f x -> LLVMExtensionExpr f y -> Maybe (x :~: y) # | |
TraversableFC LLVMExtensionExpr Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax traverseFC :: forall f g m. Applicative m => (forall (x :: k). f x -> m (g x)) -> forall (x :: l). LLVMExtensionExpr f x -> m (LLVMExtensionExpr g x) # |
data LLVMStmt (f :: CrucibleType -> Type) :: CrucibleType -> Type where Source #
Extension statements for LLVM. These statements represent the operations necessary to interact with the LLVM memory model.
LLVM_PushFrame :: !Text -> !(GlobalVar Mem) -> LLVMStmt f UnitType | Indicate the beginning of a new stack frame upon entry to a function. |
LLVM_PopFrame :: !(GlobalVar Mem) -> LLVMStmt f UnitType | Indicate the end of the current stack frame upon exit from a function. |
LLVM_Alloca :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (BVType wptr)) -> !Alignment -> !String -> LLVMStmt f (LLVMPointerType wptr) | Allocate a new memory object in the current stack frame. This memory will be automatically deallocated when the corresponding PopFrame statement is executed. |
LLVM_Load :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(TypeRepr tp) -> !StorageType -> !Alignment -> LLVMStmt f tp | Load a value from the memory. The load is defined only if the given pointer is a live pointer; if the bytes in the memory at that location can be read and reconstructed into a value of the desired type; and if the given pointer is actually aligned according to the given alignment value. |
LLVM_Store :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(TypeRepr tp) -> !StorageType -> !Alignment -> !(f tp) -> LLVMStmt f UnitType | Store a value in to the memory. The store is defined only if the given pointer is a live pointer; if the given value fits into the memory object at the location pointed to; and the given pointer is aligned according to the given alignment value. |
LLVM_MemClear :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !Bytes -> LLVMStmt f UnitType | Clear a region of memory by setting all the bytes in it to the zero byte. This is primarily used for initializing the value of global variables, but can also result from zero initializers. |
LLVM_LoadHandle :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(Maybe Type) -> !(f (LLVMPointerType wptr)) -> !(CtxRepr args) -> !(TypeRepr ret) -> LLVMStmt f (FunctionHandleType args ret) | Load the Crucible function handle that corresponds to a function pointer value. This load is defined only if the given pointer was previously allocated as a function pointer value and associated with a Crucible function handle of the expected type. |
LLVM_ResolveGlobal :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> GlobalSymbol -> LLVMStmt f (LLVMPointerType wptr) | Resolve the given global symbol name to a pointer value. |
LLVM_PtrEq :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f BoolType | Test two pointer values for equality. Note! This operation is defined only in case both pointers are live or null. |
LLVM_PtrLe :: HasPtrWidth wptr => !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f BoolType | Test two pointer values for ordering. Note! This operation is only defined if both pointers are live pointers into the same memory object. |
LLVM_PtrAddOffset :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (BVType wptr)) -> LLVMStmt f (LLVMPointerType wptr) | Add an offset value to a pointer. Note! This operation is only defined if both the input pointer is a live pointer, and the resulting computed pointer remains in the bounds of its associated memory object (or one past the end). |
LLVM_PtrSubtract :: HasPtrWidth wptr => !(NatRepr wptr) -> !(GlobalVar Mem) -> !(f (LLVMPointerType wptr)) -> !(f (LLVMPointerType wptr)) -> LLVMStmt f (BVType wptr) | Compute the offset between two pointer values. Note! This operation is only defined if both pointers are live pointers into the same memory object. |
LLVM_Debug :: !(LLVM_Dbg f c) -> LLVMStmt f UnitType | Debug information |
Instances
TypeApp LLVMStmt Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax appType :: forall (f :: CrucibleType -> Type) (x :: CrucibleType). LLVMStmt f x -> TypeRepr x # | |
PrettyApp LLVMStmt Source # | |
FoldableFC LLVMStmt Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax foldMapFC :: forall f m. Monoid m => (forall (x :: k). f x -> m) -> forall (x :: l). LLVMStmt f x -> m # foldrFC :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVMStmt f x -> b # foldlFC :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVMStmt f x -> b # foldrFC' :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVMStmt f x -> b # foldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVMStmt f x -> b # toListFC :: (forall (x :: k). f x -> a) -> forall (x :: l). LLVMStmt f x -> [a] # | |
FunctorFC LLVMStmt Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax | |
OrdFC LLVMStmt Source # | |
TestEqualityFC LLVMStmt Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax | |
TraversableFC LLVMStmt Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax traverseFC :: forall f g m. Applicative m => (forall (x :: k). f x -> m (g x)) -> forall (x :: l). LLVMStmt f x -> m (LLVMStmt g x) # |
data LLVM_Dbg f c where Source #
Debug statement variants - these have no semantic meaning
LLVM_Dbg_Addr :: HasPtrWidth wptr => !(f (LLVMPointerType wptr)) -> DILocalVariable -> DIExpression -> LLVM_Dbg f (LLVMPointerType wptr) | Annotates a value pointed to by a pointer with local-variable debug information https://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-addr |
LLVM_Dbg_Declare :: HasPtrWidth wptr => !(f (LLVMPointerType wptr)) -> DILocalVariable -> DIExpression -> LLVM_Dbg f (LLVMPointerType wptr) | Annotates a value pointed to by a pointer with local-variable debug information https://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-declare |
LLVM_Dbg_Value :: !(TypeRepr c) -> !(f c) -> DILocalVariable -> DIExpression -> LLVM_Dbg f c | Annotates a value with local-variable debug information https://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-value |
Instances
PrettyApp LLVM_Dbg Source # | |
FoldableFC LLVM_Dbg Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax foldMapFC :: forall f m. Monoid m => (forall (x :: k). f x -> m) -> forall (x :: l). LLVM_Dbg f x -> m # foldrFC :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVM_Dbg f x -> b # foldlFC :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVM_Dbg f x -> b # foldrFC' :: (forall (x :: k). f x -> b -> b) -> forall (x :: l). b -> LLVM_Dbg f x -> b # foldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> LLVM_Dbg f x -> b # toListFC :: (forall (x :: k). f x -> a) -> forall (x :: l). LLVM_Dbg f x -> [a] # | |
FunctorFC LLVM_Dbg Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax | |
OrdFC LLVM_Dbg Source # | |
TestEqualityFC LLVM_Dbg Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax | |
TraversableFC LLVM_Dbg Source # | |
Defined in Lang.Crucible.LLVM.Extension.Syntax traverseFC :: forall f g m. Applicative m => (forall (x :: k). f x -> m (g x)) -> forall (x :: l). LLVM_Dbg f x -> m (LLVM_Dbg g x) # |
traverseConds :: Applicative m => (forall s. f s -> m (g s)) -> NonEmpty (LLVMSideCondition f) -> m (NonEmpty (LLVMSideCondition g)) Source #
ppAlignment :: Alignment -> Doc ann Source #
The Crucible extension type marker for LLVM.
Instances
Data LLVM Source # | |
Defined in Lang.Crucible.LLVM.Extension gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LLVM -> c LLVM # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LLVM # dataTypeOf :: LLVM -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LLVM) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LLVM) # gmapT :: (forall b. Data b => b -> b) -> LLVM -> LLVM # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LLVM -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LLVM -> r # gmapQ :: (forall d. Data d => d -> u) -> LLVM -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LLVM -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LLVM -> m LLVM # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LLVM -> m LLVM # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LLVM -> m LLVM # | |
Generic LLVM Source # | |
IsSyntaxExtension LLVM Source # | |
Defined in Lang.Crucible.LLVM.Extension | |
Eq LLVM Source # | |
Ord LLVM Source # | |
type Rep LLVM Source # | |
type ExprExtension LLVM Source # | |
Defined in Lang.Crucible.LLVM.Extension | |
type StmtExtension LLVM Source # | |
Defined in Lang.Crucible.LLVM.Extension |