diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-12-13 22:53:54 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-12-15 10:06:55 +0000 |
commit | d59c59f4d106a5d0dff0ecb164f7a669bee03c13 (patch) | |
tree | f6c837d6b320275ad560fff6277e6e33d9d7ccb5 /compiler/main/TidyPgm.hs | |
parent | fbb42b2ea42b6467135f26db47d9c296e7ad75a3 (diff) | |
download | haskell-d59c59f4d106a5d0dff0ecb164f7a669bee03c13.tar.gz |
Make Core Lint check for locally-bound GlobalIds
There should be no bindings in this module for a GlobalId;
except after CoreTidy, when top-level bindings are globalised.
To check for this, I had to make the CoreToDo pass part of the
environment that Core Lint caries. But CoreToDo is defined in
CoreMonad, which (before this patch) called CoreLint.
So I had to do quite a bit of refactoring, moving some
lint-invoking code into CoreLint itself. Crucially, I also
more tcLookupImported_maybe, importDecl, and checkwiredInTyCon
from TcIface (which use CoreLint) to LoadIface (which doesn't).
This is probably better structure anyway.
So most of this patch is refactoring. The actual check for
GlobalIds is in CoreLint.lintAndScopeId
Diffstat (limited to 'compiler/main/TidyPgm.hs')
-rw-r--r-- | compiler/main/TidyPgm.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs index ed37225219..a32f206273 100644 --- a/compiler/main/TidyPgm.hs +++ b/compiler/main/TidyPgm.hs @@ -21,6 +21,7 @@ import CoreTidy import CoreMonad import CorePrep import CoreUtils +import CoreLint import Literal import Rules import PatSyn @@ -142,12 +143,12 @@ mkBootModDetailsTc hsc_env = do { let dflags = hsc_dflags hsc_env ; showPassIO dflags CoreTidy - ; let { insts' = map (tidyClsInstDFun globaliseAndTidyId) insts + ; let { insts' = map (tidyClsInstDFun globaliseAndTidyId) insts ; type_env1 = mkBootTypeEnv (availsToNameSet exports) (typeEnvIds type_env) tcs fam_insts - ; pat_syns' = map (tidyPatSynIds globaliseAndTidyId) pat_syns + ; pat_syns' = map (tidyPatSynIds globaliseAndTidyId) pat_syns ; type_env2 = extendTypeEnvWithPatSyns pat_syns' type_env1 - ; dfun_ids = map instanceDFunId insts' + ; dfun_ids = map instanceDFunId insts' ; type_env' = extendTypeEnvWithIds type_env2 dfun_ids } ; return (ModDetails { md_types = type_env' |