summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-08-05 19:49:53 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-12-11 12:57:35 -0500
commit381eb66012c2b1b9ef50008df57293fe443c2972 (patch)
tree1e1a98d2e5ffcae35a5189c58ce5442cf6126013 /compiler/GHC
parent19703bc83732525cd8309b1e07815840fcc622fb (diff)
downloadhaskell-381eb66012c2b1b9ef50008df57293fe443c2972.tar.gz
Display FFI labels (fix #18539)
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Types/ForeignCall.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/compiler/GHC/Types/ForeignCall.hs b/compiler/GHC/Types/ForeignCall.hs
index 0951016524..ac24d4ea4d 100644
--- a/compiler/GHC/Types/ForeignCall.hs
+++ b/compiler/GHC/Types/ForeignCall.hs
@@ -206,24 +206,26 @@ instance Outputable CExportSpec where
instance Outputable CCallSpec where
ppr (CCallSpec fun cconv safety)
- = hcat [ whenPprDebug callconv, ppr_fun fun ]
+ = hcat [ whenPprDebug callconv, ppr_fun fun, text " ::" ]
where
callconv = text "{-" <> ppr cconv <> text "-}"
- gc_suf | playSafe safety = text "_GC"
- | otherwise = empty
+ gc_suf | playSafe safety = text "_safe"
+ | otherwise = text "_unsafe"
- ppr_fun (StaticTarget st _fn mPkgId isFun)
- = text (if isFun then "__pkg_ccall"
- else "__pkg_ccall_value")
+ ppr_fun (StaticTarget st lbl mPkgId isFun)
+ = text (if isFun then "__ffi_static_ccall"
+ else "__ffi_static_ccall_value")
<> gc_suf
<+> (case mPkgId of
Nothing -> empty
Just pkgId -> ppr pkgId)
+ <> text ":"
+ <> ppr lbl
<+> (pprWithSourceText st empty)
ppr_fun DynamicTarget
- = text "__dyn_ccall" <> gc_suf <+> text "\"\""
+ = text "__ffi_dyn_ccall" <> gc_suf <+> text "\"\""
-- The filename for a C header file
-- Note [Pragma source text] in GHC.Types.SourceText