Skip to content

Commit

Permalink
cli: Allow client libraries to use bak to create ExtensionImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Aug 16, 2024
1 parent efd654f commit 7d1ed44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions crucible-cli/src/Lang/Crucible/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ defaultSimulateProgramHooks = SimulateProgramHooks

simulateProgramWithExtension
:: (IsSyntaxExtension ext, ?parserHooks :: ParserHooks ext)
=> (forall sym. IsSymInterface sym => sym -> IO (ExtensionImpl () sym ext))
=> (forall sym bak. IsSymBackend sym bak => bak -> IO (ExtensionImpl () sym ext))
-> FilePath -- ^ The name of the input (appears in source locations)
-> Text -- ^ The contents of the input
-> Handle -- ^ A handle that will receive the output
Expand Down Expand Up @@ -159,7 +159,7 @@ simulateProgramWithExtension mkExt fn theInput outh profh opts hooks =
(UseCFG ssa (postdomInfo ssa))
m)
fwdDecFnBindings cs
ext <- mkExt sym
ext <- mkExt bak
let simCtx = initSimContext bak emptyIntrinsicTypes ha outh fns ext ()
let simSt = InitialState simCtx gst defaultAbortHandler retType $
runOverrideSim retType $
Expand Down Expand Up @@ -257,7 +257,7 @@ data Command
-- line), and this function takes care of the rest.
execCommand ::
(IsSyntaxExtension ext, ?parserHooks :: ParserHooks ext) =>
(forall sym. IsSymInterface sym => sym -> IO (ExtensionImpl () sym ext)) ->
(forall sym bak. IsSymBackend sym bak => bak -> IO (ExtensionImpl () sym ext)) ->
SimulateProgramHooks ext ->
Command ->
IO ()
Expand Down
4 changes: 2 additions & 2 deletions crucible-cli/src/Lang/Crucible/CLI/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Lang.Crucible.CLI.Options (main) where

import Lang.Crucible.Backend (IsSymInterface)
import Lang.Crucible.Backend (IsSymBackend)
import Lang.Crucible.CFG.Extension (IsSyntaxExtension)
import Lang.Crucible.Simulator.ExecutionTree (ExtensionImpl)

Expand Down Expand Up @@ -53,7 +53,7 @@ parseCheck =
main ::
(?parserHooks :: ParserHooks ext, IsSyntaxExtension ext) =>
String ->
(forall sym. IsSymInterface sym => sym -> IO (ExtensionImpl () sym ext)) ->
(forall sym bak. IsSymBackend sym bak => bak -> IO (ExtensionImpl () sym ext)) ->
SimulateProgramHooks ext ->
IO ()
main name ext simulationHooks =
Expand Down
4 changes: 2 additions & 2 deletions crucible-llvm-cli/src/Lang/Crucible/LLVM/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import qualified Data.Map as Map

import Data.Parameterized.NatRepr (knownNat)

import Lang.Crucible.Backend (IsSymInterface)
import Lang.Crucible.Backend (IsSymBackend)
import Lang.Crucible.FunctionHandle (newHandleAllocator)
import Lang.Crucible.Simulator.ExecutionTree (ExtensionImpl)
import Lang.Crucible.Simulator.OverrideSim (writeGlobal)
Expand Down Expand Up @@ -43,7 +43,7 @@ import Lang.Crucible.LLVM.Syntax.TypeAlias (typeAliasParserHooks, x86_64LinuxTyp
withLlvmHooks ::
(forall w.
(HasPtrWidth w, ?parserHooks :: ParserHooks LLVM) =>
(forall sym. IsSymInterface sym => sym -> IO (ExtensionImpl () sym LLVM)) ->
(forall sym bak. IsSymBackend sym bak => bak -> IO (ExtensionImpl () sym LLVM)) ->
SimulateProgramHooks LLVM ->
IO a) ->
IO a
Expand Down

0 comments on commit 7d1ed44

Please sign in to comment.