Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crucible-llvm: Generalize LLVMOverride's ext parameter #1184

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crucible-llvm: Generalize the ext of SomeLLVMOverride
  • Loading branch information
langston-barrett committed Mar 21, 2024
commit c2cf4c930824e543494f971af5945f961d86709b
8 changes: 4 additions & 4 deletions crucible-llvm/src/Lang/Crucible/LLVM/Intrinsics/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ data LLVMOverride p sym ext args ret =
-- (@OverrideSim@).
}

data SomeLLVMOverride p sym =
forall args ret. SomeLLVMOverride (LLVMOverride p sym LLVM args ret)
data SomeLLVMOverride p sym ext =
forall args ret. SomeLLVMOverride (LLVMOverride p sym ext args ret)

-- | Convenient LLVM representation of the @size_t@ type.
llvmSizeT :: HasPtrWidth wptr => L.Type
Expand Down Expand Up @@ -292,15 +292,15 @@ build_llvm_override fnm args ret args' ret' llvmOverride =
polymorphic1_llvm_override :: forall p sym arch wptr l a rtp.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
String ->
(forall w. (1 <= w) => NatRepr w -> SomeLLVMOverride p sym) ->
(forall w. (1 <= w) => NatRepr w -> SomeLLVMOverride p sym LLVM) ->
OverrideTemplate p sym arch rtp l a
polymorphic1_llvm_override prefix fn =
OverrideTemplate (PrefixMatch prefix) (register_1arg_polymorphic_override prefix fn)

register_1arg_polymorphic_override :: forall p sym arch wptr l a rtp.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
String ->
(forall w. (1 <= w) => NatRepr w -> SomeLLVMOverride p sym) ->
(forall w. (1 <= w) => NatRepr w -> SomeLLVMOverride p sym LLVM) ->
RegOverrideM p sym arch rtp l a ()
register_1arg_polymorphic_override prefix overrideFn =
do (L.Declare{ L.decName = L.Symbol nm },_,_) <- ask
Expand Down
4 changes: 2 additions & 2 deletions crucible-llvm/src/Lang/Crucible/LLVM/Intrinsics/Libcxx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ register_cpp_override someCPPOverride =
data SomeCPPOverride p sym arch =
SomeCPPOverride
{ cppOverrideSubstrings :: [String]
, cppOverrideAction :: L.Declare -> ABI.DecodedName -> LLVMContext arch -> Maybe (SomeLLVMOverride p sym)
, cppOverrideAction :: L.Declare -> ABI.DecodedName -> LLVMContext arch -> Maybe (SomeLLVMOverride p sym LLVM)
}

------------------------------------------------------------------------
Expand Down Expand Up @@ -126,7 +126,7 @@ panic_ from decl args ret =
-- function handle in the symbol table and use that to construct an override
mkOverride :: (IsSymInterface sym, HasPtrWidth (ArchWidth arch))
=> [String] -- ^ Substrings for name filtering
-> (forall args ret. L.Declare -> CtxRepr args -> TypeRepr ret -> Maybe (SomeLLVMOverride p sym))
-> (forall args ret. L.Declare -> CtxRepr args -> TypeRepr ret -> Maybe (SomeLLVMOverride p sym LLVM))
-> (L.Symbol -> ABI.DecodedName -> Bool)
-> SomeCPPOverride p sym arch
mkOverride substrings ov filt =
Expand Down
Loading