X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Fcompiler%2FsimplCore%2FSimplCore.lhs;h=dfd9ac5c536681668095cef8e397f58071fce4e8;hb=435af9cf41c85ee69da5ecdaad5830e79c9c33d7;hp=97e38a34884c2a5829ace66102bf43e84028b791;hpb=937b23b94b458172442ac583f8d5b6f5a093a24b;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs index 97e38a3..dfd9ac5 100644 --- a/ghc/compiler/simplCore/SimplCore.lhs +++ b/ghc/compiler/simplCore/SimplCore.lhs @@ -39,23 +39,20 @@ import IdInfo ( InlinePragInfo(..), specInfo, setSpecInfo, ) import VarEnv import VarSet +import Module ( Module ) import Name ( mkLocalName, tidyOccName, tidyTopName, initTidyOccEnv, isExported, - Module, NamedThing(..), OccName + NamedThing(..), OccName ) import TyCon ( TyCon, isDataTyCon ) import PrimOp ( PrimOp(..) ) -import PrelInfo ( unpackCStringId, unpackCString2Id, - integerZeroId, integerPlusOneId, - integerPlusTwoId, integerMinusOneId, - int2IntegerId, addr2IntegerId - ) +import PrelInfo ( unpackCStringId, unpackCString2Id, addr2IntegerId ) import Type ( Type, splitAlgTyConApp_maybe, isUnLiftedType, tidyType, tidyTypes, tidyTopType, tidyTyVar, tidyTyVars, Type ) import Class ( Class, classSelIds ) -import TysWiredIn ( isIntegerTy ) +import TysWiredIn ( smallIntegerDataCon, isIntegerTy ) import LiberateCase ( liberateCase ) import SAT ( doStaticArgs ) import Specialise ( specProgram) @@ -117,6 +114,9 @@ doCorePass us binds CoreDoFullLaziness = _scc_ "CoreFloating" floatOutwa doCorePass us binds CoreDoStaticArgs = _scc_ "CoreStaticArgs" doStaticArgs us binds doCorePass us binds CoreDoStrictness = _scc_ "CoreStranal" saWwTopBinds us binds doCorePass us binds CoreDoSpecialising = _scc_ "Specialise" specProgram us binds +doCorePass us binds CoreDoPrintCore = _scc_ "PrintCore" do + putStr (showSDoc $ pprCoreBindings binds) + return binds \end{code} @@ -634,20 +634,15 @@ litToRep (NoRepStr s ty) If an Integer is small enough (Haskell implementations must support Ints in the range $[-2^29+1, 2^29-1]$), wrap it up in @int2Integer@; -otherwise, wrap with @litString2Integer@. +otherwise, wrap with @addr2Integer@. \begin{code} litToRep (NoRepInteger i integer_ty) = returnPM (integer_ty, rhs) where - rhs | i == 0 = Var integerZeroId -- Extremely convenient to look out for - | i == 1 = Var integerPlusOneId -- a few very common Integer literals! - | i == 2 = Var integerPlusTwoId - | i == (-1) = Var integerMinusOneId - - | i > tARGET_MIN_INT && -- Small enough, so start from an Int + rhs | i > tARGET_MIN_INT && -- Small enough, so start from an Int i < tARGET_MAX_INT - = App (Var int2IntegerId) (Con (Literal (mkMachInt i)) []) + = Con (DataCon smallIntegerDataCon) [Con (Literal (mkMachInt i)) []] | otherwise -- Big, so start from a string = App (Var addr2IntegerId) (Con (Literal (MachStr (_PK_ (show i)))) [])