Skip to content

Commit 47a2d45

Browse files
committed
Support building with GHC 9.4
This contains a variety of tweaks needed to make the libraries in the `macaw` repo build with GHC 9.4: * `ST` no longer has a `MonadFail` instance. See [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#st-is-no-longer-an-instance-of-monadfail) of the GHC 9.4 Migration Guide. To adapt to this change, I had to change some uses of `fail` to `error`, and I also had to avoid some partial pattern matches in `do`-notation to avoid incurring `MonadFail (ST s)` constraints. * GHC 9.4 is pickier about undecidable superclass checking. As such, I needed to explicitly enable `UndecidableSuperClasses` in a handful of places. * The following submodule changes were brought in to support building with GHC 9.4: * `asl-translator`: GaloisInc/asl-translator#51 * `bv-sized`: GaloisInc/bv-sized#27 * `bv-sized-float`: GaloisInc/bv-sized-float#4 * `crucible`: GaloisInc/crucible#1073 (This also requires bumping the `llvm-pretty`, `llvm-pretty-bc-parser`, and `what4` submodules as a side effect) * `dismantle`: GaloisInc/dismantle#40 * `grift`: GaloisInc/grift#8 * `macaw-loader`: GaloisInc/macaw-loader#17 * `semmc`: GaloisInc/semmc#79
1 parent 0686e5d commit 47a2d45

File tree

15 files changed

+16
-13
lines changed

15 files changed

+16
-13
lines changed

base/src/Data/Macaw/CFG/Core.hs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ single CFG.
2323
{-# LANGUAGE TypeFamilies #-}
2424
{-# LANGUAGE TypeOperators #-}
2525
{-# LANGUAGE UndecidableInstances #-}
26+
{-# LANGUAGE UndecidableSuperClasses #-}
2627
module Data.Macaw.CFG.Core
2728
( -- * Stmt level declarations
2829
Stmt(..)

base/src/Data/Macaw/CFG/Rewriter.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ addBinding srcId val = Rewriter $ do
185185
lift $ do
186186
m <- readSTRef ref
187187
when (MapF.member srcId m) $ do
188-
fail $ "Assignment " ++ show srcId ++ " is already bound."
188+
error $ "Assignment " ++ show srcId ++ " is already bound."
189189
writeSTRef ref $! MapF.insert srcId val m
190190

191191
-- | Return true if values are identical
@@ -716,7 +716,7 @@ rewriteValue v =
716716
srcMap <- lift $ readSTRef ref
717717
case MapF.lookup aid srcMap of
718718
Just tgtVal -> pure tgtVal
719-
Nothing -> fail $ "Could not resolve source assignment " ++ show aid ++ "."
719+
Nothing -> error $ "Could not resolve source assignment " ++ show aid ++ "."
720720
Initial r -> pure (Initial r)
721721

722722
-- | Apply optimizations to a statement.

base/src/Data/Macaw/Memory.hs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Declares 'Memory', a type for representing segmented memory with permissions.
1515
{-# LANGUAGE StandaloneDeriving #-}
1616
{-# LANGUAGE TemplateHaskell #-}
1717
{-# LANGUAGE TypeOperators #-}
18+
{-# LANGUAGE UndecidableSuperClasses #-}
1819
module Data.Macaw.Memory
1920
( Memory
2021
-- * Inspecting memory

deps/crucible

Submodule crucible updated 65 files

deps/dismantle

deps/llvm-pretty

macaw-semmc/src/Data/Macaw/SemMC/Operands.hs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{-# LANGUAGE TypeFamilies #-}
77
{-# LANGUAGE TypeOperators #-}
88
{-# LANGUAGE TypeSynonymInstances #-}
9+
{-# LANGUAGE UndecidableInstances #-}
910

1011
module Data.Macaw.SemMC.Operands (
1112
ExtractValue(..),

0 commit comments

Comments
 (0)