isSpecPragmaId, isExportedId, isLocalId, isGlobalId,
isRecordSelector,
isPrimOpId, isPrimOpId_maybe,
+ isFCallId, isFCallId_maybe,
isDataConId, isDataConId_maybe,
isDataConWrapId, isDataConWrapId_maybe,
isBottomingId,
import FieldLabel ( FieldLabel )
import SrcLoc ( SrcLoc )
import Outputable
-import Unique ( Unique, mkBuiltinUnique, getBuiltinUniques,
- getNumBuiltinUniques )
+import Unique ( Unique, mkBuiltinUnique )
infixl 1 `setIdUnfolding`,
`setIdArityInfo`,
-- "Template locals" typically used in unfoldings
mkTemplateLocals :: [Type] -> [Id]
-mkTemplateLocals tys = zipWith (mkSysLocal SLIT("tpl"))
- (getBuiltinUniques (length tys))
- tys
+mkTemplateLocals tys = zipWith mkTemplateLocal [1..] tys
mkTemplateLocalsNum :: Int -> [Type] -> [Id]
-- The Int gives the starting point for unique allocation
-mkTemplateLocalsNum n tys = zipWith (mkSysLocal SLIT("tpl"))
- (getNumBuiltinUniques n (length tys))
- tys
+mkTemplateLocalsNum n tys = zipWith mkTemplateLocal [n..] tys
mkTemplateLocal :: Int -> Type -> Id
mkTemplateLocal i ty = mkSysLocal SLIT("tpl") (mkBuiltinUnique i) ty
PrimOpId op -> Just op
other -> Nothing
+isFCallId id = case globalIdDetails id of
+ FCallId call -> True
+ other -> False
+
+isFCallId_maybe id = case globalIdDetails id of
+ FCallId call -> Just call
+ other -> Nothing
+
isDataConId id = case globalIdDetails id of
DataConId _ -> True
other -> False
hasNoBinding id = case globalIdDetails id of
DataConId _ -> True
PrimOpId _ -> True
+ FCallId _ -> True
other -> False
isImplicitId :: Id -> Bool
isImplicitId id
= case globalIdDetails id of
RecordSelId _ -> True -- Includes dictionary selectors
+ FCallId _ -> True
PrimOpId _ -> True
DataConId _ -> True
DataConWrapId _ -> True