summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore.hs
diff options
context:
space:
mode:
authorAndre Marianiello <andremarianiello@users.noreply.github.com>2022-05-14 16:02:06 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-25 01:36:09 -0400
commit9973c0167c266dad1c9c6f2b96dbba3c29c22062 (patch)
treef2ea79ae9edacb51d7c8a815cf794f9f248eb73c /compiler/GHC/HsToCore.hs
parentcfb9faff791064fab1b308b08b6ec1be288a4675 (diff)
downloadhaskell-9973c0167c266dad1c9c6f2b96dbba3c29c22062.tar.gz
Remove HscEnv from GHC.HsToCore.Usage (related to #17957)
Metric Decrease: T16875
Diffstat (limited to 'compiler/GHC/HsToCore.hs')
-rw-r--r--compiler/GHC/HsToCore.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs
index b1a6e6f572..8e2b9849e3 100644
--- a/compiler/GHC/HsToCore.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -20,6 +20,7 @@ import GHC.Prelude
import GHC.Driver.Session
import GHC.Driver.Config
+import GHC.Driver.Config.HsToCore.Usage
import GHC.Driver.Env
import GHC.Driver.Backend
import GHC.Driver.Plugins
@@ -215,7 +216,11 @@ deSugar hsc_env
; safe_mode <- finalSafeMode dflags tcg_env
; (needed_mods, needed_pkgs) <- readIORef (tcg_th_needed_deps tcg_env)
- ; usages <- mkUsageInfo hsc_env mod (imp_mods imports) used_names
+ ; let uc = initUsageConfig hsc_env
+ ; let plugins = hsc_plugins hsc_env
+ ; let fc = hsc_FC hsc_env
+ ; let unit_env = hsc_unit_env hsc_env
+ ; usages <- mkUsageInfo uc plugins fc unit_env mod (imp_mods imports) used_names
dep_files merged needed_mods needed_pkgs
-- id_mod /= mod when we are processing an hsig, but hsigs
-- never desugared and compiled (there's no code!)