Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC Commits: 64ed2f41 by Rodrigo Mesquita at 2026-05-06T13:25:50+01:00 constPtrConName - - - - - 4 changed files: - compiler/GHC/Builtin/KnownKeys.hs - compiler/GHC/HsToCore/Foreign/C.hs - libraries/base/src/GHC/Essentials.hs - libraries/ghc-internal/src/GHC/Internal/Foreign/C/ConstPtr.hs Changes: ===================================== compiler/GHC/Builtin/KnownKeys.hs ===================================== @@ -200,6 +200,9 @@ knownKeyTable , (mkVarOcc "toRational", toRationalClassOpKey) , (mkVarOcc "realToFrac", realToFracIdKey) + -- FFI things + , (mkTcOcc "ConstPtr", constPtrTyConKey) + -- Class Monad, MonadFix, MonadZip , (mkTcOcc "Monad", monadClassKey) , (thenMClassOpOcc, thenMClassOpKey) @@ -365,7 +368,7 @@ basicKnownKeyNames starArrStarArrStarKindRepName, constraintKindRepName, -- FFI primitive types that are not wired-in. - ptrTyConName, funPtrTyConName, constPtrConName, + ptrTyConName, funPtrTyConName, word8TyConName, -- Plugins @@ -459,11 +462,6 @@ pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey frontendPluginTyConName :: Name frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey -constPtrConName :: Name -constPtrConName = - tcQual gHC_INTERNAL_FOREIGN_C_CONSTPTR (fsLit "ConstPtr") constPtrTyConKey - - {- ************************************************************************ * * ===================================== compiler/GHC/HsToCore/Foreign/C.hs ===================================== @@ -241,7 +241,7 @@ dsFCall fn_id co fcall mDeclHeader = do | (_, res_ty1) <- tcSplitFunTys ty1 , newty <- maybe res_ty1 snd (tcSplitIOType_maybe res_ty1) , Just (ptr, _) <- splitTyConApp_maybe newty - , tyConName ptr == constPtrConName + , tyConName ptr `hasKnownKey` constPtrTyConKey = text "const" | otherwise = empty ===================================== libraries/base/src/GHC/Essentials.hs ===================================== @@ -75,6 +75,9 @@ module GHC.Essentials , Either(..) , Void + -- FFI + , ConstPtr + -- Show internals , showsPrec, shows, showString, showSpace, showCommaSpace, showParen @@ -299,6 +302,7 @@ import GHC.Internal.GHCi import GHC.Internal.Desugar (toAnnotationWrapper) import GHC.Internal.Stack.Types import GHC.Internal.Exception.Context +import GHC.Internal.Foreign.C.ConstPtr #if defined(javascript_HOST_ARCH) import GHC.Internal.JS.Prim (unsafeUnpackJSStringUtf8##) #endif ===================================== libraries/ghc-internal/src/GHC/Internal/Foreign/C/ConstPtr.hs ===================================== @@ -3,6 +3,7 @@ {-# LANGUAGE StandaloneKindSignatures #-} {-# LANGUAGE Trustworthy #-} +{-# OPTIONS_GHC -fdefines-known-key-names #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Internal.Foreign.C.ConstPtr View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64ed2f412343e5cdc5c0694b79f61ebe... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64ed2f412343e5cdc5c0694b79f61ebe... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)