summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-07-05 13:49:02 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-07-05 16:24:12 +0100
commitcbe30fda6d7c32415583654c8dfbfb74b1bde999 (patch)
tree21508ef44bbcf537423e3b9fcd87d5d855331885
parent895eefa8447a2886e77fdedcbca8047263c88db7 (diff)
downloadhaskell-cbe30fda6d7c32415583654c8dfbfb74b1bde999.tar.gz
Tidy up tidying
This is a tiny refactor, replacing an ad-hoc local function (TidyPgm.loookup_aux_id) with a solid global one (tidyVarOcc).
-rw-r--r--compiler/main/TidyPgm.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index 915cd12450..6ec1e0234e 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -350,7 +350,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
isExternalName (idName id)]
; type_env1 = extendTypeEnvWithIds type_env final_ids
- ; tidy_cls_insts = map (tidyClsInstDFun (lookup_aux_id tidy_type_env)) cls_insts
+ ; tidy_cls_insts = map (tidyClsInstDFun (tidyVarOcc tidy_env)) cls_insts
-- A DFunId will have a binding in tidy_binds, and so will now be in
-- tidy_type_env, replete with IdInfo. Its name will be unchanged since
-- it was born, but we want Global, IdInfo-rich (or not) DFunId in the
@@ -367,7 +367,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
-- and then override the PatSyns in the type_env with the new tidy ones
-- This is really the only reason we keep mg_patsyns at all; otherwise
-- they could just stay in type_env
- ; tidy_patsyns = map (tidyPatSynIds (lookup_aux_id tidy_type_env)) patsyns
+ ; tidy_patsyns = map (tidyPatSynIds (tidyVarOcc tidy_env)) patsyns
; type_env2 = extendTypeEnvWithPatSyns tidy_patsyns type_env1
; tidy_type_env = tidyTypeEnv omit_prags type_env2
@@ -429,12 +429,6 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
where
dflags = hsc_dflags hsc_env
-lookup_aux_id :: TypeEnv -> Var -> Id
-lookup_aux_id type_env id
- = case lookupTypeEnv type_env (idName id) of
- Just (AnId id') -> id'
- _other -> pprPanic "lookup_aux_id" (ppr id)
-
tidyTypeEnv :: Bool -- Compiling without -O, so omit prags
-> TypeEnv -> TypeEnv