module ThinAir (
thinAirIdNames, -- Names of non-wired-in Ids that may be used out of
setThinAirIds, -- thin air in any compilation. If they are not wired in
- thinAirModules, -- we must be sure to import them from some Prelude
+ -- we must be sure to import them from some Prelude
-- interface file even if they are not overtly
-- mentioned. Subset of builtinNames.
-- Here are the thin-air Ids themselves
addr2IntegerId,
- packStringForCId, unpackCStringId, unpackCString2Id,
+ unpackCStringId, unpackCString2Id,
unpackCStringAppendId, unpackCStringFoldrId,
foldrId, buildId,
= map mkKnownKeyGlobal
[
-- Needed for converting literals to Integers (used in tidyCoreExpr)
- (varQual pREL_BASE_Name SLIT("addr2Integer"), addr2IntegerIdKey)
-
- -- String literals
- , (varQual pREL_PACK_Name SLIT("packCString#"), packCStringIdKey)
- , (varQual pREL_PACK_Name SLIT("unpackCString#"), unpackCStringIdKey)
- , (varQual pREL_PACK_Name SLIT("unpackNBytes#"), unpackCString2IdKey)
- , (varQual pREL_PACK_Name SLIT("unpackAppendCString#"), unpackCStringAppendIdKey)
- , (varQual pREL_PACK_Name SLIT("unpackFoldrCString#"), unpackCStringFoldrIdKey)
+ (varQual pREL_NUM_Name SLIT("addr2Integer"), addr2IntegerIdKey)
-- Folds and builds; introduced by desugaring list comprehensions
+ , (varQual pREL_BASE_Name SLIT("unpackNBytes#"), unpackCString2IdKey)
+ , (varQual pREL_BASE_Name SLIT("unpackCString#"), unpackCStringIdKey)
+ , (varQual pREL_BASE_Name SLIT("unpackAppendCString#"), unpackCStringAppendIdKey)
+ , (varQual pREL_BASE_Name SLIT("unpackFoldrCString#"), unpackCStringFoldrIdKey)
+
, (varQual pREL_BASE_Name SLIT("foldr"), foldrIdKey)
, (varQual pREL_BASE_Name SLIT("build"), buildIdKey)
]
varQual = mkPreludeQual varName
-
-thinAirModules = [pREL_PACK_Name,pREL_BASE_Name] -- See notes with RnIfaces.findAndReadIface
\end{code}
addr2IntegerId = lookupThinAirId addr2IntegerIdKey
-packStringForCId = lookupThinAirId packCStringIdKey
unpackCStringId = lookupThinAirId unpackCStringIdKey
unpackCString2Id = lookupThinAirId unpackCString2IdKey
unpackCStringAppendId = lookupThinAirId unpackCStringAppendIdKey
\end{code}
\begin{code}
+{-# NOINLINE thinAirIdMapRef #-}
thinAirIdMapRef :: IORef (UniqFM Id)
thinAirIdMapRef = unsafePerformIO (newIORef (panic "thinAirIdMap: still empty"))