Add Pretty.zeroWidth{F,P}Text, use it in Cmm Ppr
This is ultimately so that we can drop the length field of `FastString`. The Cmm pretty printer doesn't look at the width anyway, so eagerly computing it is redundant. There are a multitude of occurrences of `text` in `compiler/GHC/Cmm`, but they mostly rewrite to `ptext` anyway, where computing the length isn't particularly expensive, so I refrained from changing these occurrences to `zeroWidthText` for the time being. From the three proposed approaches in #17069 (comment 259689) this one seemed like the simplest and least intrusive; plus, there is already precedent with `Pretty.zeroWidthText`. Fixes #17069.
parent
abc02b40
No related branches found
No related tags found
Pipeline #17176 passed with warnings
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Cmm/CLabel.hs 12 additions, 12 deletionscompiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Cmm/Ppr.hs
- compiler/utils/Outputable.hs 9 additions, 0 deletionscompiler/utils/Outputable.hs
- compiler/utils/Pretty.hs 23 additions, 6 deletionscompiler/utils/Pretty.hs
Loading
Please register or sign in to comment