summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/Coverage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/HsToCore/Coverage.hs')
-rw-r--r--compiler/GHC/HsToCore/Coverage.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs
index 54a3ba0ca0..ea176aa438 100644
--- a/compiler/GHC/HsToCore/Coverage.hs
+++ b/compiler/GHC/HsToCore/Coverage.hs
@@ -49,6 +49,7 @@ import GHC.Types.Name
import GHC.Types.HpcInfo
import GHC.Types.CostCentre
import GHC.Types.CostCentre.State
+import GHC.Types.ForeignStubs
import Control.Monad
import Data.List (isSuffixOf, intersperse)
@@ -1323,10 +1324,10 @@ static void hpc_init_Main(void)
hs_hpc_module("Main",8,1150288664,_hpc_tickboxes_Main_hpc);}
-}
-hpcInitCode :: DynFlags -> Module -> HpcInfo -> SDoc
-hpcInitCode _ _ (NoHpcInfo {}) = Outputable.empty
+hpcInitCode :: DynFlags -> Module -> HpcInfo -> CStub
+hpcInitCode _ _ (NoHpcInfo {}) = mempty
hpcInitCode dflags this_mod (HpcInfo tickCount hashNo)
- = vcat
+ = CStub $ vcat
[ text "static void hpc_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void hpc_init_" <> ppr this_mod <> text "(void)"