Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Macaw.CFG.AssignRhs
Synopsis
- data AssignRhs arch (f :: Type -> Type) (tp :: Type) where
- EvalApp :: forall (f :: Type -> Type) (tp :: Type) arch. !(App f tp) -> AssignRhs arch f tp
- SetUndefined :: forall (tp :: Type) arch (f :: Type -> Type). !(TypeRepr tp) -> AssignRhs arch f tp
- ReadMem :: forall (f :: Type -> Type) arch (tp :: Type). !(f (BVType (ArchAddrWidth arch))) -> !(MemRepr tp) -> AssignRhs arch f tp
- CondReadMem :: forall (tp :: Type) (f :: Type -> Type) arch. !(MemRepr tp) -> !(f BoolType) -> !(f (BVType (ArchAddrWidth arch))) -> !(f tp) -> AssignRhs arch f tp
- EvalArchFn :: forall arch (f :: Type -> Type) (tp :: Type). !(ArchFn arch f tp) -> !(TypeRepr tp) -> AssignRhs arch f tp
- data MemRepr (tp :: Type) where
- BVMemRepr :: forall (w :: Natural). 1 <= w => !(NatRepr w) -> !Endianness -> MemRepr ('BVType (8 * w))
- FloatMemRepr :: forall (f :: FloatInfo). !(FloatInfoRepr f) -> !Endianness -> MemRepr ('FloatType f)
- PackedVecMemRepr :: forall (n :: Nat) (tp1 :: Type). !(NatRepr n) -> !(MemRepr tp1) -> MemRepr ('VecType n tp1)
- memReprBytes :: forall (tp :: Type). MemRepr tp -> Natural
- type family RegAddrWidth (r :: Type -> Type) :: Nat
- type family ArchReg arch = (reg :: Type -> Type) | reg -> arch
- type family ArchFn arch = (fn :: (Type -> Type) -> Type -> Type) | fn -> arch
- type family ArchStmt arch = (stmt :: (Type -> Type) -> Type) | stmt -> arch
- type family ArchTermStmt arch :: (Type -> Type) -> Type
- type RegAddrWord (r :: Type -> Type) = MemWord (RegAddrWidth r)
- type ArchAddrWidth arch = RegAddrWidth (ArchReg arch)
- type ArchAddrWord arch = RegAddrWord (ArchReg arch)
- type ArchMemAddr arch = MemAddr (ArchAddrWidth arch)
Documentation
data AssignRhs arch (f :: Type -> Type) (tp :: Type) where Source #
The right hand side of an assignment is an expression that returns a value.
Constructors
EvalApp :: forall (f :: Type -> Type) (tp :: Type) arch. !(App f tp) -> AssignRhs arch f tp | An expression that is computed from evaluating subexpressions. |
SetUndefined :: forall (tp :: Type) arch (f :: Type -> Type). !(TypeRepr tp) -> AssignRhs arch f tp | An expression with an undefined value. |
ReadMem :: forall (f :: Type -> Type) arch (tp :: Type). !(f (BVType (ArchAddrWidth arch))) -> !(MemRepr tp) -> AssignRhs arch f tp | Read memory at given location. |
CondReadMem :: forall (tp :: Type) (f :: Type -> Type) arch. !(MemRepr tp) -> !(f BoolType) -> !(f (BVType (ArchAddrWidth arch))) -> !(f tp) -> AssignRhs arch f tp |
|
EvalArchFn :: forall arch (f :: Type -> Type) (tp :: Type). !(ArchFn arch f tp) -> !(TypeRepr tp) -> AssignRhs arch f tp |
Instances
FoldableFC (ArchFn arch) => FoldableFC (AssignRhs arch :: (Type -> Type) -> Type -> Type) Source # | |
Defined in Data.Macaw.CFG.AssignRhs Methods foldMapFC :: forall f m. Monoid m => (forall (x :: Type). f x -> m) -> forall (x :: Type). AssignRhs arch f x -> m # foldrFC :: (forall (x :: Type). f x -> b -> b) -> forall (x :: Type). b -> AssignRhs arch f x -> b # foldlFC :: forall f b. (forall (x :: Type). b -> f x -> b) -> forall (x :: Type). b -> AssignRhs arch f x -> b # foldrFC' :: (forall (x :: Type). f x -> b -> b) -> forall (x :: Type). b -> AssignRhs arch f x -> b # foldlFC' :: forall f b. (forall (x :: Type). b -> f x -> b) -> forall (x :: Type). b -> AssignRhs arch f x -> b # toListFC :: (forall (x :: Type). f x -> a) -> forall (x :: Type). AssignRhs arch f x -> [a] # | |
HasRepr (AssignRhs arch f :: Type -> Type) TypeRepr Source # | |
ArchConstraints arch => Pretty (AssignRhs arch (Value arch ids) tp) | |
Defined in Data.Macaw.CFG.Core |
MemRepr
data MemRepr (tp :: Type) where Source #
The provides information sufficient to read supported types of values from memory such as the number of bytes and endianness.
Constructors
BVMemRepr :: forall (w :: Natural). 1 <= w => !(NatRepr w) -> !Endianness -> MemRepr ('BVType (8 * w)) | Denotes a bitvector with the given number of bytes and endianness. |
FloatMemRepr :: forall (f :: FloatInfo). !(FloatInfoRepr f) -> !Endianness -> MemRepr ('FloatType f) | A floating point value (stored in given endianness. |
PackedVecMemRepr :: forall (n :: Nat) (tp1 :: Type). !(NatRepr n) -> !(MemRepr tp1) -> MemRepr ('VecType n tp1) | A vector of values with zero entry first. The first value is stored at the address, the second is stored at address + sizeof eltType, etc. |
Instances
TestEquality MemRepr Source # | |
Defined in Data.Macaw.CFG.AssignRhs | |
HashableF MemRepr Source # | |
Defined in Data.Macaw.CFG.AssignRhs | |
OrdF MemRepr Source # | |
Defined in Data.Macaw.CFG.AssignRhs Methods compareF :: forall (x :: Type) (y :: Type). MemRepr x -> MemRepr y -> OrderingF x y leqF :: forall (x :: Type) (y :: Type). MemRepr x -> MemRepr y -> Bool ltF :: forall (x :: Type) (y :: Type). MemRepr x -> MemRepr y -> Bool geqF :: forall (x :: Type) (y :: Type). MemRepr x -> MemRepr y -> Bool gtF :: forall (x :: Type) (y :: Type). MemRepr x -> MemRepr y -> Bool | |
HasRepr MemRepr TypeRepr Source # | |
Show (MemRepr tp) Source # | |
Eq (MemRepr tp) Source # | |
Hashable (MemRepr tp) Source # | |
Defined in Data.Macaw.CFG.AssignRhs | |
Pretty (MemRepr tp) Source # | |
Defined in Data.Macaw.CFG.AssignRhs |
memReprBytes :: forall (tp :: Type). MemRepr tp -> Natural Source #
Return the number of bytes this uses in memory.
Architecture type families
type family RegAddrWidth (r :: Type -> Type) :: Nat Source #
Width of register used to store addresses.
type family ArchReg arch = (reg :: Type -> Type) | reg -> arch Source #
Type family for defining what a "register" is for this architecture.
Registers include things like the general purpose registers, any flag registers that can be read and written without side effects,
type family ArchFn arch = (fn :: (Type -> Type) -> Type -> Type) | fn -> arch Source #
A type family for architecture specific functions.
The functions associated with architecture-function depend on the
contents of memory and implicit components of the processor state,
but they should not affect any of the architecture
registers in ArchReg arch
.
Architecture specific functions are required to implement
FoldableFC
, and the evaluation of an architecture specific
function may only depend on the value stored in a general purpose
register if it is given through the fn
parameter and provided
when folding over values. This is required for accurate def-use
analysis of general purpose registers.
type family ArchStmt arch = (stmt :: (Type -> Type) -> Type) | stmt -> arch Source #
A type family for defining architecture-specific statements.
The second parameter is used to denote the underlying values in the statements so that we can use ArchStmts with multiple CFGs.
type family ArchTermStmt arch :: (Type -> Type) -> Type Source #
A type family for defining architecture-specific statements that may have instruction-specific effects on control-flow and register state.
An architecture-specific terminal statement may have side effects and change register values, it may or may not return to the current function.
Note that the meaning of the type parameter is identical to that of ArchStmt
Synonyms
type RegAddrWord (r :: Type -> Type) = MemWord (RegAddrWidth r) Source #
A word for the given architecture register type.
type ArchAddrWidth arch = RegAddrWidth (ArchReg arch) Source #
Number of bits in addreses for architecture.
type ArchAddrWord arch = RegAddrWord (ArchReg arch) Source #
A word for the given architecture bitwidth.
type ArchMemAddr arch = MemAddr (ArchAddrWidth arch) Source #
An address for a given architecture.