Use a primop for getting the fields of the AP_STACK rather than an FFI call
[ghc-hetmet.git] / compiler / main / HscTypes.lhs
index 126f07f..d385c5f 100644 (file)
@@ -73,8 +73,7 @@ import ByteCodeAsm    ( CompiledByteCode )
 import {-# SOURCE #-}  InteractiveEval ( Resume )
 #endif
 
-import RdrName         ( GlobalRdrEnv, emptyGlobalRdrEnv,
-                         LocalRdrEnv, emptyLocalRdrEnv, GlobalRdrElt(..), 
+import RdrName         ( GlobalRdrEnv, emptyGlobalRdrEnv, GlobalRdrElt(..), 
                           unQualOK, ImpDeclSpec(..), Provenance(..),
                           ImportSpec(..), lookupGlobalRdrEnv )
 import Name            ( Name, NamedThing, getName, nameOccName, nameModule )
@@ -96,7 +95,7 @@ import TyCon
 import DataCon         ( DataCon, dataConImplicitIds )
 import PrelNames       ( gHC_PRIM )
 import Packages                ( PackageId )
-import DynFlags                ( DynFlags(..), DynFlag(..), isOneShot, HscTarget (..) )
+import DynFlags                ( DynFlags(..), isOneShot, HscTarget (..) )
 import DriverPhases    ( HscSource(..), isHsBoot, hscSourceString, Phase )
 import BasicTypes      ( Version, initialVersion, IPName, 
                          Fixity, defaultFixity, DeprecTxt )
@@ -624,8 +623,8 @@ data InteractiveContext
                                        -- ic_toplev_scope and ic_exports
 
        ic_tmp_ids :: [Id],             -- Names bound during interaction.
-                                        -- Earlier Ids shadow
-                                        -- later ones with the same OccName.
+                                        -- Later Ids shadow
+                                        -- earlier ones with the same OccName.
 
         ic_tyvars :: TyVarSet           -- skolem type variables free in
                                         -- ic_tmp_ids.  These arise at
@@ -660,7 +659,9 @@ extendInteractiveContext
         -> TyVarSet
         -> InteractiveContext
 extendInteractiveContext ictxt ids tyvars
-  = ictxt { ic_tmp_ids =  ids ++ ic_tmp_ids ictxt,
+  = ictxt { ic_tmp_ids =  ic_tmp_ids ictxt ++ ids,
+                          -- NB. must be this way around, because we want
+                          -- new ids to shadow existing bindings.
             ic_tyvars   = ic_tyvars ictxt `unionVarSet` tyvars }
 \end{code}