summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-01-27 09:58:59 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2021-03-03 19:11:08 +0000
commit7b9767b81f4f0b25b0c0402593be1182b9546bab (patch)
treee446784907016969d94c30cd1beabed6af45d462 /compiler/GHC/Iface
parentf121ffe4be7dd156701d856fbc9afeaf50e7038e (diff)
downloadhaskell-7b9767b81f4f0b25b0c0402593be1182b9546bab.tar.gz
Use a newtype for CHeader and CStub in ForeignStubs
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r--compiler/GHC/Iface/Tidy/StaticPtrTable.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/Iface/Tidy/StaticPtrTable.hs b/compiler/GHC/Iface/Tidy/StaticPtrTable.hs
index 0606728900..0a61f63aed 100644
--- a/compiler/GHC/Iface/Tidy/StaticPtrTable.hs
+++ b/compiler/GHC/Iface/Tidy/StaticPtrTable.hs
@@ -148,6 +148,7 @@ import GHC.Linker.Types
import GHC.Types.Name
import GHC.Types.Id
import GHC.Types.TyThing
+import GHC.Types.ForeignStubs
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.State
@@ -264,9 +265,9 @@ sptCreateStaticBinds hsc_env this_mod binds
--
-- @fps@ is a list associating each binding corresponding to a static entry with
-- its fingerprint.
-sptModuleInitCode :: Platform -> Module -> [SptEntry] -> SDoc
-sptModuleInitCode _ _ [] = Outputable.empty
-sptModuleInitCode platform this_mod entries = vcat
+sptModuleInitCode :: Platform -> Module -> [SptEntry] -> CStub
+sptModuleInitCode _ _ [] = mempty
+sptModuleInitCode platform this_mod entries = CStub $ vcat
[ text "static void hs_spt_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void hs_spt_init_" <> ppr this_mod <> text "(void)"