diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-11-10 12:08:33 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-11-11 12:44:01 -0500 |
commit | f921298fd05c84442fb44bc0733016695cdf1b25 (patch) | |
tree | fb1552200913b3ca56227708daa56a6678814aaf /compiler/GHC/Core | |
parent | 56705da84a8e954d9755270ca8bb37a43d7d03a9 (diff) | |
download | haskell-wip/user-ticker.tar.gz |
Add support for defining ticky tickers in Corewip/user-ticker
This allows the user to define new ticky tickers via a new Core Tickish
type, `TickyCtr`. These behave like source notes in the sense that they
try to interfere minimally with simplification. It is intended that they
be introduced by Core-to-Core plugins late in the Core pipeline.
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r-- | compiler/GHC/Core/Ppr.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Core/Seq.hs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs index f1791dfebf..0540e05609 100644 --- a/compiler/GHC/Core/Ppr.hs +++ b/compiler/GHC/Core/Ppr.hs @@ -674,3 +674,5 @@ instance Outputable (XTickishId pass) => Outputable (GenTickish pass) where _ -> hcat [text "scc<", ppr cc, char '>'] ppr (SourceNote span _) = hcat [ text "src<", pprUserRealSpan True span, char '>'] + ppr (TickyCounter mod name) = + hcat [ text "ticker<", ppr mod <+> text name, char '>'] diff --git a/compiler/GHC/Core/Seq.hs b/compiler/GHC/Core/Seq.hs index 0addae9775..6d822c95b4 100644 --- a/compiler/GHC/Core/Seq.hs +++ b/compiler/GHC/Core/Seq.hs @@ -77,6 +77,7 @@ seqTickish ProfNote{ profNoteCC = cc } = cc `seq` () seqTickish HpcTick{} = () seqTickish Breakpoint{ breakpointFVs = ids } = seqBndrs ids seqTickish SourceNote{} = () +seqTickish TickyCounter{} = () seqBndr :: CoreBndr -> () seqBndr b | isTyVar b = seqType (tyVarKind b) |