summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-12-02 15:04:18 +0100
committerBen Gamari <ben@smart-cactus.org>2020-12-03 13:26:47 -0500
commitd47a75d73fdd258679b0d86281408c731849b7d9 (patch)
treee3d13f8c666f1c70fa0919dadf00293eaf50c9d9
parent41c64eb5db50c80e110e47b7ab1c1ee18dada46b (diff)
downloadhaskell-wip/andreask/ppr_foreign_labels.tar.gz
Include C label when pretty printing FFI calls.wip/andreask/ppr_foreign_labels
When looking at lets say an STG dump I really do want to know what function is being called. With this patch no longer hides this information. This should fix #19020
-rw-r--r--compiler/GHC/Types/ForeignCall.hs3
-rw-r--r--testsuite/tests/numeric/should_compile/all.T2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Types/ForeignCall.hs b/compiler/GHC/Types/ForeignCall.hs
index 0951016524..e51f8bd31b 100644
--- a/compiler/GHC/Types/ForeignCall.hs
+++ b/compiler/GHC/Types/ForeignCall.hs
@@ -213,9 +213,10 @@ instance Outputable CCallSpec where
gc_suf | playSafe safety = text "_GC"
| otherwise = empty
- ppr_fun (StaticTarget st _fn mPkgId isFun)
+ ppr_fun (StaticTarget st fn mPkgId isFun)
= text (if isFun then "__pkg_ccall"
else "__pkg_ccall_value")
+ <> parens (ppr fn)
<> gc_suf
<+> (case mPkgId of
Nothing -> empty
diff --git a/testsuite/tests/numeric/should_compile/all.T b/testsuite/tests/numeric/should_compile/all.T
index 7c39541e5b..9ed98aa21e 100644
--- a/testsuite/tests/numeric/should_compile/all.T
+++ b/testsuite/tests/numeric/should_compile/all.T
@@ -8,4 +8,4 @@ test('T7881', normal, compile, [''])
# desugaring, so we don't get the warning we expect.
test('T8542', omit_ways(['hpc']), compile, [''])
test('T10929', normal, compile, [''])
-test('T16402', [ grep_errmsg(r'and') ], compile, [''])
+test('T16402', [ grep_errmsg(r'and#') ], compile, [''])