Safe Haskell | None |
---|
LLVM.Analysis.AccessPath
Contents
Description
This module defines an abstraction over field accesses of
structures called AccessPaths. A concrete access path is rooted at
a value, while an abstract access path is rooted at a type. Both
include a list of AccessType
s that denote dereferences of
pointers, field accesses, and array references.
- data AccessPath = AccessPath {
- accessPathBaseValue :: Value
- accessPathEndValue :: Value
- accessPathComponents :: [AccessType]
- data AbstractAccessPath = AbstractAccessPath {}
- data AccessType
- = AccessField !Int
- | AccessArray
- | AccessDeref
- data AccessPathError
- accessPath :: Failure AccessPathError m => Instruction -> m AccessPath
- abstractAccessPath :: AccessPath -> AbstractAccessPath
- appendAccessPath :: AbstractAccessPath -> AbstractAccessPath -> Maybe AbstractAccessPath
- followAccessPath :: Failure AccessPathError m => AbstractAccessPath -> Value -> m Value
- reduceAccessPath :: AbstractAccessPath -> Maybe AbstractAccessPath
- externalizeAccessPath :: AbstractAccessPath -> Maybe (String, [AccessType])
Types
data AccessPath Source
Constructors
AccessPath | |
Fields
|
Instances
Eq AccessPath | |
Ord AccessPath | |
Show AccessPath | |
NFData AccessPath | |
Hashable AccessPath |
data AbstractAccessPath Source
The sequence of field accesses used to reference a field structure.
Constructors
AbstractAccessPath | |
Fields
|
data AccessPathError Source
Constructor
accessPath :: Failure AccessPathError m => Instruction -> m AccessPathSource
followAccessPath :: Failure AccessPathError m => AbstractAccessPath -> Value -> m ValueSource
reduceAccessPath :: AbstractAccessPath -> Maybe AbstractAccessPathSource
If the access path has more than one field access component, take the first field access and the base type to compute a new base type (the type of the indicated field) and the rest of the path components. Also allows for the discarding of array accesses.
Each call reduces the access path by one component
externalizeAccessPath :: AbstractAccessPath -> Maybe (String, [AccessType])Source
Convert an AbstractAccessPath
to a format that can be written
to disk and read back into another process. The format is the pair
of the base name of the structure field being accessed (with
struct. stripped off) and with any numeric suffixes (which are
added by llvm) chopped off. The actually list of AccessType
s is
preserved.
The struct name mangling here basically assumes that the types exposed via the access path abstraction have the same definition in all compilation units. Ensuring this between runs is basically impossible, but it is pretty much always the case.