summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Marianiello <andremarianiello@users.noreply.github.com>2022-05-08 15:24:17 -0400
committerandremarianiello <andre.marianiello@gmail.com>2022-05-12 02:15:48 +0000
commit3a022baa1967e2df2ed19341de38b004dc07c04f (patch)
tree0f41c5edb4a320570097d3a2f9e7237f0e8117cb
parenta2dcad4e6f75c08aacc5902a20ca4c773819d7b7 (diff)
downloadhaskell-3a022baa1967e2df2ed19341de38b004dc07c04f.tar.gz
Remove Module argument from initCmmParserConfig
-rw-r--r--compiler/GHC/Driver/Config/Cmm/Parser.hs9
-rw-r--r--compiler/GHC/Driver/Main.hs3
-rw-r--r--testsuite/tests/regalloc/regalloc_unit_tests.hs3
3 files changed, 6 insertions, 9 deletions
diff --git a/compiler/GHC/Driver/Config/Cmm/Parser.hs b/compiler/GHC/Driver/Config/Cmm/Parser.hs
index 3749bfd87c..4cd1c25b49 100644
--- a/compiler/GHC/Driver/Config/Cmm/Parser.hs
+++ b/compiler/GHC/Driver/Config/Cmm/Parser.hs
@@ -9,8 +9,7 @@ import GHC.Driver.Config.Parser
import GHC.Driver.Config.StgToCmm
import GHC.Driver.Session
-import GHC.Unit.Types
-
+import GHC.Utils.Panic
initPDConfig :: DynFlags -> PDConfig
initPDConfig dflags = PDConfig
@@ -18,10 +17,10 @@ initPDConfig dflags = PDConfig
, pdSanitizeAlignment = gopt Opt_AlignmentSanitisation dflags
}
-initCmmParserConfig :: DynFlags -> Module -> CmmParserConfig
-initCmmParserConfig dflags mod = CmmParserConfig
+initCmmParserConfig :: DynFlags -> CmmParserConfig
+initCmmParserConfig dflags = CmmParserConfig
{ cmmpParserOpts = initParserOpts dflags
, cmmpPDConfig = initPDConfig dflags
- , cmmpStgToCmmConfig = initStgToCmmConfig dflags mod
+ , cmmpStgToCmmConfig = initStgToCmmConfig dflags (panic "initCmmParserConfig: no module")
}
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index 2e42a9767a..f45cdc8020 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -1746,8 +1746,7 @@ hscCompileCmmFile hsc_env original_filename filename output_filename = runHsc hs
-- lest we reproduce #11784.
mod_name = mkModuleName $ "Cmm$" ++ original_filename
cmm_mod = mkHomeModule home_unit mod_name
- no_module = panic "hscCompileCmmFile: no module"
- cmmpConfig = initCmmParserConfig dflags no_module
+ cmmpConfig = initCmmParserConfig dflags
(cmm, ents) <- ioMsgMaybe
$ do
(warns,errs,cmm) <- withTiming logger (text "ParseCmm"<+>brackets (text filename)) (\_ -> ())
diff --git a/testsuite/tests/regalloc/regalloc_unit_tests.hs b/testsuite/tests/regalloc/regalloc_unit_tests.hs
index 04e59a9ce9..d6ffcc3431 100644
--- a/testsuite/tests/regalloc/regalloc_unit_tests.hs
+++ b/testsuite/tests/regalloc/regalloc_unit_tests.hs
@@ -133,8 +133,7 @@ compileCmmForRegAllocStats logger dflags cmmFile ncgImplF us = do
-- parse the cmm file and output any warnings or errors
let fake_mod = mkHomeModule (hsc_home_unit hscEnv) (mkModuleName "fake")
- no_module = panic "compileCmmForRegAllocStats: no module"
- cmmpConfig = initCmmParserConfig dflags no_module
+ cmmpConfig = initCmmParserConfig dflags
(warnings, errors, parsedCmm) <- parseCmmFile cmmpConfig fake_mod (hsc_home_unit hscEnv) cmmFile
-- print parser errors or warnings