summaryrefslogtreecommitdiff
path: root/compiler/simplCore/FloatOut.hs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2016-01-15 18:24:14 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2016-01-15 18:31:46 +0100
commit5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 (patch)
treee15571a0370aa7759a73ea0cd079699bcf61d073 /compiler/simplCore/FloatOut.hs
parentb90cac69b2abec7df998d1d447b3fe075eb8f15c (diff)
downloadhaskell-wip/ptext-sLit-cleanup.tar.gz
Replace calls to `ptext . sLit` with `text`wip/ptext-sLit-cleanup
Summary: In the past the canonical way for constructing an SDoc string literal was the composition `ptext . sLit`. But for some time now we have function `text` that does the same. Plus it has some rules that optimize its runtime behaviour. This patch takes all uses of `ptext . sLit` in the compiler and replaces them with calls to `text`. The main benefits of this patch are clener (shorter) code and less dependencies between module, because many modules now do not need to import `FastString`. I don't expect any performance benefits - we mostly use SDocs to report errors and it seems there is little to be gained here. Test Plan: ./validate Reviewers: bgamari, austin, goldfire, hvr, alanz Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1784
Diffstat (limited to 'compiler/simplCore/FloatOut.hs')
-rw-r--r--compiler/simplCore/FloatOut.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/simplCore/FloatOut.hs b/compiler/simplCore/FloatOut.hs
index 7f920a230e..3c220fed74 100644
--- a/compiler/simplCore/FloatOut.hs
+++ b/compiler/simplCore/FloatOut.hs
@@ -27,7 +27,6 @@ import Bag
import Util
import Maybes
import Outputable
-import FastString
import qualified Data.IntMap as M
#include "HsVersions.h"
@@ -130,9 +129,9 @@ floatOutwards float_sws dflags us pgm
let { (tlets, ntlets, lams) = get_stats (sum_stats fss) };
dumpIfSet_dyn dflags Opt_D_dump_simpl_stats "FloatOut stats:"
- (hcat [ int tlets, ptext (sLit " Lets floated to top level; "),
- int ntlets, ptext (sLit " Lets floated elsewhere; from "),
- int lams, ptext (sLit " Lambda groups")]);
+ (hcat [ int tlets, text " Lets floated to top level; ",
+ int ntlets, text " Lets floated elsewhere; from ",
+ int lams, text " Lambda groups"]);
return (bagToList (unionManyBags binds_s'))
}
@@ -481,9 +480,9 @@ data FloatBinds = FB !(Bag FloatLet) -- Destined for top level
instance Outputable FloatBinds where
ppr (FB fbs defs)
- = ptext (sLit "FB") <+> (braces $ vcat
- [ ptext (sLit "tops =") <+> ppr fbs
- , ptext (sLit "non-tops =") <+> ppr defs ])
+ = text "FB" <+> (braces $ vcat
+ [ text "tops =" <+> ppr fbs
+ , text "non-tops =" <+> ppr defs ])
flattenTopFloats :: FloatBinds -> Bag CoreBind
flattenTopFloats (FB tops defs)