ghci: Serialise mi_top_env
When loading core from interface files (or from a bytecode object in future) it's important to store what the top-level context of a module is. Otherwise, when you load the module into GHCi from the interface files, only exported identifiers from the top-level module are in scope on the repl. See the added test which demonstrates what this enables. The context at the GHCi prompt is everything that's in-scope in the TopEnvIface module. Since TopEnvIface imports identifier "a", we can evaluate "a" in the repl. In addition to all this, we can use this information in order to implement reifyModule in a more principled manner. This becomes even more important when you're debugging and what to set break-points on functions which are not imported.
Showing
- compiler/GHC/Iface/Make.hs 8 additions, 13 deletionscompiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Syntax.hs 37 additions, 3 deletionscompiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs 6 additions, 7 deletionscompiler/GHC/IfaceToCore.hs
- compiler/GHC/Rename/Env.hs 2 additions, 0 deletionscompiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Names.hs 1 addition, 1 deletioncompiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Eval.hs 15 additions, 10 deletionscompiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Types.hs 1 addition, 1 deletioncompiler/GHC/Tc/Types.hs
- compiler/GHC/Types/Avail.hs 7 additions, 2 deletionscompiler/GHC/Types/Avail.hs
- compiler/GHC/Types/Name/Reader.hs 17 additions, 0 deletionscompiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/PkgQual.hs 19 additions, 0 deletionscompiler/GHC/Types/PkgQual.hs
- compiler/GHC/Unit/Module/ModIface.hs 21 additions, 19 deletionscompiler/GHC/Unit/Module/ModIface.hs
- testsuite/tests/ghci/should_run/Makefile 6 additions, 0 deletionstestsuite/tests/ghci/should_run/Makefile
- testsuite/tests/ghci/should_run/TopEnvIface.hs 4 additions, 0 deletionstestsuite/tests/ghci/should_run/TopEnvIface.hs
- testsuite/tests/ghci/should_run/TopEnvIface.stdout 8 additions, 0 deletionstestsuite/tests/ghci/should_run/TopEnvIface.stdout
- testsuite/tests/ghci/should_run/TopEnvIface2.hs 3 additions, 0 deletionstestsuite/tests/ghci/should_run/TopEnvIface2.hs
- testsuite/tests/ghci/should_run/all.T 1 addition, 0 deletionstestsuite/tests/ghci/should_run/all.T
Loading
Please register or sign in to comment