Copyright | (c) Galois Inc 2011-2018 |
---|---|
License | BSD3 |
Maintainer | Joe Hendrix <jhendrix@galois.com> |
Stability | provisional |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides functionality for querying simulator type information in a module, and converting llvm-pretty types into simulator types.
Synopsis
- data TypeContext
- mkTypeContext :: DataLayout -> MetadataMap -> [TypeDecl] -> ([Doc ann], TypeContext)
- typeContextFromModule :: Module -> ([Doc ann], TypeContext)
- llvmDataLayout :: TypeContext -> DataLayout
- llvmMetadataMap :: TypeContext -> MetadataMap
- type AliasMap = Map Ident SymType
- llvmAliasMap :: TypeContext -> AliasMap
- compatMemTypes :: MemType -> MemType -> Bool
- compatRetTypes :: RetType -> RetType -> Bool
- compatMemTypeLists :: [MemType] -> [MemType] -> Bool
- lookupAlias :: (?lc :: TypeContext, MonadError String m) => Ident -> m SymType
- lookupMetadata :: (?lc :: TypeContext) => Int -> Maybe ValMd
- liftType :: (?lc :: TypeContext, MonadError String m) => Type -> m SymType
- liftMemType :: (?lc :: TypeContext, MonadError String m) => Type -> m MemType
- liftRetType :: (?lc :: TypeContext, MonadError String m) => Type -> m RetType
- liftDeclare :: (?lc :: TypeContext, MonadError String m) => Declare -> m FunDecl
- asMemType :: (?lc :: TypeContext, MonadError String m) => SymType -> m MemType
LLVMContext
data TypeContext Source #
Provides information about the types in an LLVM bitcode file.
Instances
Show TypeContext Source # | |
Defined in Lang.Crucible.LLVM.TypeContext showsPrec :: Int -> TypeContext -> ShowS # show :: TypeContext -> String # showList :: [TypeContext] -> ShowS # |
mkTypeContext :: DataLayout -> MetadataMap -> [TypeDecl] -> ([Doc ann], TypeContext) Source #
Creates an LLVMContext from a parsed data layout and lists of types. Errors reported in first argument.
typeContextFromModule :: Module -> ([Doc ann], TypeContext) Source #
Utility function to creates an LLVMContext directly from a model.
llvmMetadataMap :: TypeContext -> MetadataMap Source #
llvmAliasMap :: TypeContext -> AliasMap Source #
LLVMContext query functions.
compatMemTypes :: MemType -> MemType -> Bool Source #
Returns true if types are bit-level compatible.
lookupAlias :: (?lc :: TypeContext, MonadError String m) => Ident -> m SymType Source #
lookupMetadata :: (?lc :: TypeContext) => Int -> Maybe ValMd Source #
liftType :: (?lc :: TypeContext, MonadError String m) => Type -> m SymType Source #
liftMemType :: (?lc :: TypeContext, MonadError String m) => Type -> m MemType Source #
liftRetType :: (?lc :: TypeContext, MonadError String m) => Type -> m RetType Source #
liftDeclare :: (?lc :: TypeContext, MonadError String m) => Declare -> m FunDecl Source #
asMemType :: (?lc :: TypeContext, MonadError String m) => SymType -> m MemType Source #
If argument corresponds to a MemType
possibly via aliases,
then return it. Otherwise, returns Nothing
.