Commit 1aa6eb78 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-02-27 17:14:44 by simonmar]

Need to tidy the expression before compiling it, purely in order to
clone the ids in case of clashes.
parent a29fe417
......@@ -5,7 +5,7 @@
\begin{code}
module CoreTidy (
tidyCorePgm, tidyExpr,
tidyCorePgm, tidyExpr, tidyCoreExpr,
tidyBndr, tidyBndrs
) where
......@@ -157,6 +157,14 @@ tidyCorePgm dflags mod pcs binds_in orphans_in
init_tidy_env us = (us, orig_env, initTidyOccEnv avoids, emptyVarEnv)
avoids = [getOccName bndr | bndr <- bindersOfBinds binds_in,
isGlobalName (idName bndr)]
tidyCoreExpr :: CoreExpr -> IO CoreExpr
tidyCoreExpr expr
= do { us <- mkSplitUniqSupply 't' -- for "tidy"
; let (expr',_) = initUs us (tidyExpr emptyTidyEnv expr)
; return expr'
}
\end{code}
......
......@@ -38,6 +38,7 @@ import SimplCore
import CoreUtils ( coreBindsSize )
import CoreTidy ( tidyCorePgm )
import CoreSat
import CoreTidy ( tidyCoreExpr )
import CoreToStg ( coreToStg )
import SimplStg ( stg2stg )
import CodeGen ( codeGen )
......@@ -59,15 +60,14 @@ import CmStaticInfo ( GhciMode(..) )
import HscStats ( ppSourceStats )
import HscTypes ( ModDetails, ModIface(..), PersistentCompilerState(..),
PersistentRenamerState(..), ModuleLocation(..),
HomeSymbolTable, InteractiveContext(..), TyThing(..),
HomeSymbolTable, InteractiveContext(..),
NameSupply(..), PackageRuleBase, HomeIfaceTable,
typeEnvClasses, typeEnvTyCons, emptyIfaceTable,
extendLocalRdrEnv
typeEnvClasses, typeEnvTyCons, emptyIfaceTable
)
import FiniteMap ( FiniteMap, plusFM, emptyFM, addToFM )
import OccName ( OccName )
import Name ( Name, nameModule, nameOccName, getName, isGlobalName,
emptyNameEnv, extendNameEnvList
emptyNameEnv
)
import Module ( Module, lookupModuleEnvByName )
......@@ -480,8 +480,11 @@ hscStmt dflags hst hit pcs0 icontext stmt
-- Simplify it
; simpl_expr <- simplifyExpr dflags pcs2 hst ds_expr
-- Tidy it (temporary, until coreSat does cloning)
; tidy_expr <- tidyCoreExpr simpl_expr
-- Saturate it
; sat_expr <- coreSatExpr dflags simpl_expr
; sat_expr <- coreSatExpr dflags tidy_expr
-- Convert to BCOs
; bcos <- coreExprToBCOs dflags sat_expr
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment