diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2016-01-15 18:24:14 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2016-01-18 18:54:10 +0100 |
commit | b8abd852d3674cb485490d2b2e94906c06ee6e8f (patch) | |
tree | eddf226b9c10be8b9b982ed29c1ef61841755c6f /compiler/codeGen | |
parent | 817dd925569d981523bbf4fb471014d46c51c7db (diff) | |
download | haskell-b8abd852d3674cb485490d2b2e94906c06ee6e8f.tar.gz |
Replace calls to `ptext . sLit` with `text`
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/codeGen')
-rw-r--r-- | compiler/codeGen/StgCmmClosure.hs | 5 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmEnv.hs | 3 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index d10903d78f..d3b9fac34a 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -74,7 +74,6 @@ import CLabel import Id import IdInfo import DataCon -import FastString import Name import Type import TyCoRep @@ -104,8 +103,8 @@ data CgLoc -- and branch to the block id instance Outputable CgLoc where - ppr (CmmLoc e) = ptext (sLit "cmm") <+> ppr e - ppr (LneLoc b rs) = ptext (sLit "lne") <+> ppr b <+> ppr rs + ppr (CmmLoc e) = text "cmm" <+> ppr e + ppr (LneLoc b rs) = text "lne" <+> ppr b <+> ppr rs type SelfLoopInfo = (Id, BlockId, [LocalReg]) diff --git a/compiler/codeGen/StgCmmEnv.hs b/compiler/codeGen/StgCmmEnv.hs index 4127b67401..8dbb646cdc 100644 --- a/compiler/codeGen/StgCmmEnv.hs +++ b/compiler/codeGen/StgCmmEnv.hs @@ -38,7 +38,6 @@ import MkGraph import BlockId import CmmExpr import CmmUtils -import FastString import Id import VarEnv import Control.Monad @@ -158,7 +157,7 @@ cgLookupPanic id = do local_binds <- getBinds pprPanic "StgCmmEnv: variable not found" (vcat [ppr id, - ptext (sLit "local binds for:"), + text "local binds for:", vcat [ ppr (cg_id info) | info <- varEnvElts local_binds ] ]) diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index 42033200c8..2742acdcdb 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -214,7 +214,7 @@ data CgIdInfo instance Outputable CgIdInfo where ppr (CgIdInfo { cg_id = id, cg_loc = loc }) - = ppr id <+> ptext (sLit "-->") <+> ppr loc + = ppr id <+> text "-->" <+> ppr loc -- Sequel tells what to do with the result of this expression data Sequel @@ -232,8 +232,8 @@ data Sequel -- allocating primOp) instance Outputable Sequel where - ppr (Return b) = ptext (sLit "Return") <+> ppr b - ppr (AssignTo regs b) = ptext (sLit "AssignTo") <+> ppr regs <+> ppr b + ppr (Return b) = text "Return" <+> ppr b + ppr (AssignTo regs b) = text "AssignTo" <+> ppr regs <+> ppr b -- See Note [sharing continuations] below data ReturnKind |