crucible-llvm-0.8.0.0: Support for translating and executing LLVM code in Crucible
Copyright(c) Galois Inc 2024
LicenseBSD3
MaintainerLangston Barrett <langston@galois.com>
Stabilityprovisional
Safe HaskellNone
LanguageHaskell2010

Lang.Crucible.LLVM.Intrinsics.Cast

Description

The built-in overrides in Lang.Crucible.LLVM.Intrinsics.Libc and Lang.Crucible.LLVM.Intrinsics.LLVM frequently take arguments of type BVType, but at runtime everything is represented as an LLVMPtr. This module contains helpers for "casting" between pointers and bitvectors.

Synopsis

Documentation

printValCastError :: ValCastError -> [String] Source #

Turn a ValCastError into a human-readable message (lines).

data ArgCast p sym ext (args :: Ctx CrucibleType) (args' :: Ctx CrucibleType) Source #

A function to (infallibly) cast between Assignments of RegEntrys.

data ValCast p sym ext (tp :: CrucibleType) (tp' :: CrucibleType) Source #

A function to (infallibly) cast a value of types tp to tp'.

castLLVMArgs Source #

Arguments

:: forall p sym ext bak (args :: Ctx CrucibleType) (args' :: Ctx CrucibleType). IsSymBackend sym bak 
=> FunctionName

Only used in error messages

-> bak 
-> CtxRepr args' 
-> CtxRepr args 
-> Either ValCastError (ArgCast p sym ext args args') 

Attempt to construct a function to cast between Assignments of RegEntrys.

castLLVMRet Source #

Arguments

:: forall sym bak (ret :: CrucibleType) (ret' :: CrucibleType) p ext. IsSymBackend sym bak 
=> FunctionName

Only used in error messages

-> bak 
-> TypeRepr ret 
-> TypeRepr ret' 
-> Either ValCastError (ValCast p sym ext ret ret') 

Attempt to construct a function to cast values of type ret to type ret'.