Skip to content

Commit

Permalink
Merge pull request #2225 from ucsd-progsys/fd/explicit-ghc-imports2
Browse files Browse the repository at this point in the history
Add more explicit import lists to Liquid.GHC.API
  • Loading branch information
facundominguez authored Sep 21, 2023
2 parents 9c761a4 + ffbc1e7 commit e641476
Show file tree
Hide file tree
Showing 11 changed files with 407 additions and 32 deletions.
419 changes: 400 additions & 19 deletions liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import Liquid.GHC.API as Ghc hiding ( (<+>)
, vcat
, parens
, ($+$)
, LC
)
import Language.Haskell.Liquid.Misc (thrd3)
import Language.Haskell.Liquid.WiredIn (wiredSortedSyms)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import Liquid.GHC.API as Ghc hiding ( text
, vcat
, showPpr
, mkStableModule
, Target
, Located
)
import qualified Liquid.GHC.API as Ghc
Expand Down
3 changes: 0 additions & 3 deletions liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,6 @@ gHC_VERSION = show (__GLASGOW_HASKELL__ :: Int)
symbolFastString :: Symbol -> FastString
symbolFastString = mkFastStringByteString . T.encodeUtf8 . symbolText

lintCoreBindings :: [Var] -> CoreProgram -> (Bag SDoc, Bag SDoc)
lintCoreBindings = Ghc.lintCoreBindings (defaultDynFlags undefined (undefined ("LlvmTargets" :: String))) CoreDoNothing

synTyConRhs_maybe :: TyCon -> Maybe Type
synTyConRhs_maybe = Ghc.synTyConRhs_maybe

Expand Down
2 changes: 1 addition & 1 deletion liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Play.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import qualified Data.HashMap.Strict as M
import qualified Data.List as L
import qualified Data.Maybe as Mb

import Liquid.GHC.API as Ghc hiding (substTysWith, panic,showPpr)
import Liquid.GHC.API as Ghc hiding (panic, showPpr)
import Language.Haskell.Liquid.GHC.Misc ()
import Language.Haskell.Liquid.Types.Errors
import Language.Haskell.Liquid.Types.Variance
Expand Down
4 changes: 2 additions & 2 deletions liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Plugin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Language.Haskell.Liquid.GHC.Plugin (
) where

import qualified Liquid.GHC.API as O
import Liquid.GHC.API as GHC hiding (Target, Type)
import Liquid.GHC.API as GHC hiding (Type)
import qualified Text.PrettyPrint.HughesPJ as PJ
import qualified Language.Fixpoint.Types as F
import qualified Language.Haskell.Liquid.GHC.Misc as LH
Expand Down Expand Up @@ -404,7 +404,7 @@ loadDependencies currentModuleConfig thisModule mods = do
hscEnv <- env_top <$> getEnv
results <- SpecFinder.findRelevantSpecs
(excludeAutomaticAssumptionsFor currentModuleConfig) hscEnv mods
deps <- foldlM processResult mempty (reverse results)
deps <- foldM processResult mempty (reverse results)
redundant <- liftIO $ configToRedundantDependencies hscEnv currentModuleConfig

debugLog $ "Redundant dependencies ==> " ++ show redundant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Data.IORef
import Data.Maybe

import Control.Exception
import Control.Monad ( foldM )
import Control.Monad.Trans ( lift )
import Control.Monad.Trans.Maybe

Expand Down Expand Up @@ -64,7 +65,7 @@ findRelevantSpecs :: [String] -- ^ Package to exclude for loading LHAssumptions
-> TcM [SpecFinderResult]
findRelevantSpecs lhAssmPkgExcludes hscEnv mods = do
eps <- liftIO $ readIORef (hsc_EPS hscEnv)
foldlM (loadRelevantSpec eps) mempty mods
foldM (loadRelevantSpec eps) mempty mods
where

loadRelevantSpec :: ExternalPackageState -> [SpecFinderResult] -> Module -> TcM [SpecFinderResult]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Language.Haskell.Liquid.GHC.Resugar (
) where

import qualified Data.List as L
import Liquid.GHC.API as Ghc hiding (PatBind)
import Liquid.GHC.API as Ghc
import qualified Language.Haskell.Liquid.GHC.Misc as GM
import qualified Language.Fixpoint.Types as F
import qualified Text.PrettyPrint.HughesPJ as PJ
Expand Down
2 changes: 1 addition & 1 deletion liquidhaskell-boot/src/Language/Haskell/Liquid/Liquid.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Language.Haskell.Liquid.Constraint.Types
import Language.Haskell.Liquid.UX.Annotate (mkOutput)
import qualified Language.Haskell.Liquid.Termination.Structural as ST
import qualified Language.Haskell.Liquid.GHC.Misc as GM
import Liquid.GHC.API as GHC hiding (text, vcat, ($+$), getOpts, (<+>))
import Liquid.GHC.API as GHC hiding (text, vcat, ($+$), (<+>))

--------------------------------------------------------------------------------
checkTargetInfo :: TargetInfo -> IO (Output Doc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ import Liquid.GHC.API as Ghc hiding ( Expr
, panic
, int
, hcat
, spans
)
import Language.Fixpoint.Types (pprint, showpp, Tidy (..), PPrint (..), Symbol, Expr, SubcId)
import qualified Language.Fixpoint.Misc as Misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ module Language.Haskell.Liquid.Types.Types (
where

import Liquid.GHC.API as Ghc hiding ( Expr
, Target
, isFunTy
, ($+$)
, nest
Expand Down

0 comments on commit e641476

Please sign in to comment.