File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
external-stg-interpreter/lib/Stg/Interpreter/GC Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 22module Stg.Interpreter.GC.GCRef where
33
44import Data.Maybe
5- import Control.Monad.State
5+ import Control.Monad
66import Foreign.Ptr
77import qualified Data.IntSet as IntSet
88import qualified Data.ByteString.Char8 as BS8
99
10- import Language.Souffle.Compiled (SouffleM )
11-
1210import Stg.Interpreter.Base
1311
1412-- HINT: populate datalog database during a traversal
1513
1614class VisitGCRef a where
17- visitGCRef :: (GCSymbol -> SouffleM () ) -> a -> SouffleM ()
15+ visitGCRef :: Monad m => (GCSymbol -> m () ) -> a -> m ()
1816
1917instance VisitGCRef Atom where
2018 visitGCRef action a = visitAtom a action
@@ -122,15 +120,15 @@ data RefNamespace
122120 | NS_StablePointer
123121 | NS_WeakPointer
124122 | NS_Thread
125- deriving (Show , Read )
123+ deriving (Eq , Ord , Show , Read )
126124
127125encodeRef :: Int -> RefNamespace -> GCSymbol
128126encodeRef i ns = GCSymbol $ BS8. pack $ show (ns, i)
129127
130128decodeRef :: GCSymbol -> (RefNamespace , Int )
131129decodeRef = read . BS8. unpack . unGCSymbol
132130
133- visitAtom :: Atom -> (GCSymbol -> SouffleM () ) -> SouffleM ()
131+ visitAtom :: Monad m => Atom -> (GCSymbol -> m () ) -> m ()
134132visitAtom atom action = case atom of
135133 HeapPtr i -> action $ encodeRef i NS_HeapPtr
136134 Literal {} -> pure ()
You can’t perform that action at this time.
0 commit comments