Completely new treatment of INLINE pragmas (big patch)
[ghc-hetmet.git] / compiler / deSugar / DsMeta.hs
index 8bb7133..b0c314b 100644 (file)
@@ -13,7 +13,7 @@
 -- a Royal Pain (triggers other recompilation).
 -----------------------------------------------------------------------------
 
-{-# OPTIONS -fno-warn-unused-imports #-}
+{-# OPTIONS -fwarn-unused-imports #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
@@ -28,10 +28,11 @@ module DsMeta( dsBracket,
               quoteExpName, quotePatName
                ) where
 
+#include "HsVersions.h"
+
 import {-# SOURCE #-}  DsExpr ( dsExpr )
 
 import MatchLit
-import DsUtils
 import DsMonad
 
 import qualified Language.Haskell.TH as TH
@@ -43,16 +44,17 @@ import PrelNames
 -- OccName.varName we do this by removing varName from the import of
 -- OccName above, making a qualified instance of OccName and using
 -- OccNameAlias.varName where varName ws previously used in this file.
-import qualified OccName
+import qualified OccName( isDataOcc, isVarOcc, isTcOcc, varName, tcName ) 
 
 import Module
 import Id
-import Name
+import Name hiding( isVarOcc, isTcOcc, varName, tcName ) 
 import NameEnv
 import TcType
 import TyCon
 import TysWiredIn
 import CoreSyn
+import MkCore
 import CoreUtils
 import SrcLoc
 import Unique
@@ -948,7 +950,7 @@ globalVar name
        ; MkC uni <- coreIntLit (getKey (getUnique name))
        ; rep2 mkNameLName [occ,uni] }
   where
-      mod = nameModule name
+      mod = ASSERT( isExternalName name) nameModule name
       name_mod = moduleNameString (moduleName mod)
       name_pkg = packageIdString (modulePackageId mod)
       name_occ = nameOccName name
@@ -1249,7 +1251,7 @@ repNamedTyCon (MkC s) = rep2 conTName [s]
 
 repTupleTyCon :: Int -> DsM (Core TH.TypeQ)
 -- Note: not Core Int; it's easier to be direct here
-repTupleTyCon i = rep2 tupleTName [mkIntExpr (fromIntegral i)]
+repTupleTyCon i = rep2 tupleTName [mkIntExprInt i]
 
 repArrowTyCon :: DsM (Core TH.TypeQ)
 repArrowTyCon = rep2 arrowTName []
@@ -1303,6 +1305,7 @@ repOverloadedLiteral (OverLit { ol_val = val})
        -- the smart constructor 'TH.Syntax.rationalL' uses it in its type,
        -- and rationalL is sucked in when any TH stuff is used
 
+mk_lit :: OverLitVal -> DsM HsLit
 mk_lit (HsIntegral i)   = mk_integer  i
 mk_lit (HsFractional f) = mk_rational f
 mk_lit (HsIsString s)   = mk_string   s
@@ -1343,7 +1346,7 @@ coreStringLit :: String -> DsM (Core String)
 coreStringLit s = do { z <- mkStringExpr s; return(MkC z) }
 
 coreIntLit :: Int -> DsM (Core Int)
-coreIntLit i = return (MkC (mkIntExpr (fromIntegral i)))
+coreIntLit i = return (MkC (mkIntExprInt i))
 
 coreVar :: Id -> Core TH.Name  -- The Id has type Name
 coreVar id = MkC (Var id)