[Git][ghc/ghc][master] compiler: remove unused hscDecls/hscDeclsWithLocation

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Oct 30 03:18:15 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
e3496ef6 by Cheng Shao at 2024-10-29T23:17:37-04:00
compiler: remove unused hscDecls/hscDeclsWithLocation

This patch removes unused `hscDecls`/`hscDeclsWithLocation` functions
from the compiler, to reduce maintenance burden when doing
refactorings related to ghci.

- - - - -


1 changed file:

- compiler/GHC/Driver/Main.hs


Changes:

=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -81,7 +81,7 @@ module GHC.Driver.Main
     , hscRnImportDecls
     , hscTcRnLookupRdrName
     , hscStmt, hscParseStmtWithLocation, hscStmtWithLocation, hscParsedStmt
-    , hscDecls, hscParseDeclsWithLocation, hscDeclsWithLocation, hscParsedDecls
+    , hscParseDeclsWithLocation, hscParsedDecls
     , hscParseModuleWithLocation
     , hscTcExpr, TcRnExprMode(..), hscImport, hscKcType
     , hscParseExpr
@@ -2461,12 +2461,6 @@ hscParsedStmt hsc_env stmt = runInteractiveHsc hsc_env $ do
 
   return $ Just (ids, hval, fix_env)
 
--- | Compile a decls
-hscDecls :: HscEnv
-         -> String -- ^ The statement
-         -> IO ([TyThing], InteractiveContext)
-hscDecls hsc_env str = hscDeclsWithLocation hsc_env str "<interactive>" 1
-
 hscParseModuleWithLocation :: HscEnv -> String -> Int -> String -> IO (HsModule GhcPs)
 hscParseModuleWithLocation hsc_env source line_num str = do
     L _ mod <-
@@ -2479,18 +2473,6 @@ hscParseDeclsWithLocation hsc_env source line_num str = do
   HsModule { hsmodDecls = decls } <- hscParseModuleWithLocation hsc_env source line_num str
   return decls
 
--- | Compile a decls
-hscDeclsWithLocation :: HscEnv
-                     -> String -- ^ The statement
-                     -> String -- ^ The source
-                     -> Int    -- ^ Starting line
-                     -> IO ([TyThing], InteractiveContext)
-hscDeclsWithLocation hsc_env str source linenumber = do
-    L _ (HsModule{ hsmodDecls = decls }) <-
-      runInteractiveHsc hsc_env $
-        hscParseThingWithLocation source linenumber parseModule str
-    hscParsedDecls hsc_env decls
-
 hscParsedDecls :: HscEnv -> [LHsDecl GhcPs] -> IO ([TyThing], InteractiveContext)
 hscParsedDecls hsc_env decls = runInteractiveHsc hsc_env $ do
     hsc_env <- getHscEnv



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3496ef6c6f4cdb8bbef8b0e9dfa61219c32a575

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3496ef6c6f4cdb8bbef8b0e9dfa61219c32a575
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241029/60d1d086/attachment-0001.html>


More information about the ghc-commits mailing list