mirror of
https://github.com/github/semantic.git
synced 2024-11-24 17:04:47 +03:00
Move ValueRoots into Control.Abstract.Roots.
This commit is contained in:
parent
58b1de14fc
commit
91122566df
@ -1,5 +1,6 @@
|
||||
module Control.Abstract.Roots
|
||||
( Live
|
||||
( ValueRoots(..)
|
||||
, Live
|
||||
, askRoots
|
||||
, extraRoots
|
||||
) where
|
||||
@ -8,6 +9,13 @@ import Control.Abstract.Evaluator
|
||||
import Data.Abstract.Live
|
||||
import Prologue
|
||||
|
||||
|
||||
-- | Value types, e.g. closures, which can root a set of addresses.
|
||||
class ValueRoots address value where
|
||||
-- | Compute the set of addresses rooted by a given value.
|
||||
valueRoots :: value -> Live address
|
||||
|
||||
|
||||
-- | Retrieve the local 'Live' set.
|
||||
askRoots :: Member (Reader (Live address)) effects => Evaluator address value effects (Live address)
|
||||
askRoots = ask
|
||||
|
@ -12,14 +12,12 @@ module Control.Abstract.Value
|
||||
, evaluateInScopedEnv
|
||||
, value
|
||||
, subtermValue
|
||||
, ValueRoots(..)
|
||||
) where
|
||||
|
||||
import Control.Abstract.Environment
|
||||
import Control.Abstract.Evaluator
|
||||
import Control.Abstract.Heap
|
||||
import Data.Abstract.Environment as Env
|
||||
import Data.Abstract.Live (Live)
|
||||
import Data.Abstract.Name
|
||||
import Data.Abstract.Number as Number
|
||||
import Data.Abstract.Ref
|
||||
@ -233,9 +231,3 @@ subtermValue :: ( AbstractValue address value effects
|
||||
=> Subterm term (Evaluator address value effects (ValueRef value))
|
||||
-> Evaluator address value effects value
|
||||
subtermValue = value <=< subtermRef
|
||||
|
||||
|
||||
-- | Value types, e.g. closures, which can root a set of addresses.
|
||||
class ValueRoots address value where
|
||||
-- | Compute the set of addresses rooted by a given value.
|
||||
valueRoots :: value -> Live address
|
||||
|
Loading…
Reference in New Issue
Block a user