[commit: ghc] ghc-8.0: Replace calls to `ptext . sLit` with `text` (f02fefd)

git at git.haskell.org git at git.haskell.org
Tue Jan 19 10:05:46 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/f02fefd3187beed98444273e5fbc2c022af5efbc/ghc

>---------------------------------------------------------------

commit f02fefd3187beed98444273e5fbc2c022af5efbc
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Fri Jan 15 18:24:14 2016 +0100

    Replace calls to `ptext . sLit` with `text`
    
    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
    
    (cherry picked from commit b8abd852d3674cb485490d2b2e94906c06ee6e8f)


>---------------------------------------------------------------

f02fefd3187beed98444273e5fbc2c022af5efbc
 compiler/basicTypes/BasicTypes.hs                  |  72 +++---
 compiler/basicTypes/DataCon.hs                     |  18 +-
 compiler/basicTypes/Demand.hs                      |   5 +-
 compiler/basicTypes/IdInfo.hs                      |  27 +-
 compiler/basicTypes/Literal.hs                     |   4 +-
 compiler/basicTypes/Name.hs                        |  10 +-
 compiler/basicTypes/OccName.hs                     |  12 +-
 compiler/basicTypes/PatSyn.hs                      |   5 +-
 compiler/basicTypes/RdrName.hs                     |  30 +--
 compiler/basicTypes/Var.hs                         |   9 +-
 compiler/basicTypes/VarEnv.hs                      |   3 +-
 compiler/cmm/CLabel.hs                             |  74 +++---
 compiler/cmm/CmmLayoutStack.hs                     |   4 +-
 compiler/cmm/CmmLint.hs                            |   5 +-
 compiler/cmm/CmmType.hs                            |   6 +-
 compiler/cmm/PprC.hs                               | 288 ++++++++++-----------
 compiler/cmm/PprCmm.hs                             |  64 ++---
 compiler/cmm/PprCmmDecl.hs                         |  18 +-
 compiler/cmm/PprCmmExpr.hs                         |  49 ++--
 compiler/cmm/SMRep.hs                              |  36 +--
 compiler/codeGen/StgCmmClosure.hs                  |   5 +-
 compiler/codeGen/StgCmmEnv.hs                      |   3 +-
 compiler/codeGen/StgCmmMonad.hs                    |   6 +-
 compiler/coreSyn/CoreArity.hs                      |   4 +-
 compiler/coreSyn/CoreLint.hs                       | 226 ++++++++--------
 compiler/coreSyn/CorePrep.hs                       |   8 +-
 compiler/coreSyn/CoreStats.hs                      |   7 +-
 compiler/coreSyn/CoreSubst.hs                      |  14 +-
 compiler/coreSyn/CoreSyn.hs                        |   3 +-
 compiler/coreSyn/CoreUnfold.hs                     |  25 +-
 compiler/coreSyn/CoreUtils.hs                      |  18 +-
 compiler/coreSyn/MkCore.hs                         |   4 +-
 compiler/coreSyn/PprCore.hs                        | 160 ++++++------
 compiler/deSugar/Check.hs                          |  34 +--
 compiler/deSugar/Coverage.hs                       |  10 +-
 compiler/deSugar/Desugar.hs                        |  22 +-
 compiler/deSugar/DsArrows.hs                       |   3 +-
 compiler/deSugar/DsBinds.hs                        |  38 +--
 compiler/deSugar/DsExpr.hs                         |  14 +-
 compiler/deSugar/DsForeign.hs                      |  24 +-
 compiler/deSugar/DsListComp.hs                     |   5 +-
 compiler/deSugar/DsMeta.hs                         |   2 +-
 compiler/deSugar/DsMonad.hs                        |  12 +-
 compiler/deSugar/MatchLit.hs                       |  16 +-
 compiler/deSugar/PmExpr.hs                         |   5 +-
 compiler/ghci/ByteCodeInstr.hs                     |  12 +-
 compiler/ghci/Linker.hs                            |  34 +--
 compiler/hsSyn/Convert.hs                          |  36 +--
 compiler/hsSyn/HsBinds.hs                          |  60 ++---
 compiler/hsSyn/HsDecls.hs                          |  77 +++---
 compiler/hsSyn/HsExpr.hs                           | 220 ++++++++--------
 compiler/hsSyn/HsImpExp.hs                         |  18 +-
 compiler/hsSyn/HsPat.hs                            |   3 +-
 compiler/hsSyn/HsSyn.hs                            |   7 +-
 compiler/hsSyn/HsTypes.hs                          |   2 +-
 compiler/iface/IfaceSyn.hs                         | 114 ++++----
 compiler/iface/IfaceType.hs                        |  16 +-
 compiler/iface/LoadIface.hs                        | 102 ++++----
 compiler/iface/MkIface.hs                          |  24 +-
 compiler/iface/TcIface.hs                          |  48 ++--
 compiler/main/DriverMkDepend.hs                    |  10 +-
 compiler/main/DriverPipeline.hs                    |   7 +-
 compiler/main/DynFlags.hs                          |   6 +-
 compiler/main/DynamicLoading.hs                    |  27 +-
 compiler/main/ErrUtils.hs                          |   7 +-
 compiler/main/Finder.hs                            |  56 ++--
 compiler/main/GhcMake.hs                           |  18 +-
 compiler/main/Hooks.hs                             |   4 +-
 compiler/main/HscMain.hs                           |   6 +-
 compiler/main/HscTypes.hs                          |  36 +--
 compiler/main/Packages.hs                          |  16 +-
 compiler/main/PprTyThing.hs                        |   5 +-
 compiler/main/SysTools.hs                          |   6 +-
 compiler/main/TidyPgm.hs                           |   5 +-
 compiler/nativeGen/AsmCodeGen.hs                   |   2 +-
 compiler/nativeGen/Dwarf.hs                        |   7 +-
 compiler/nativeGen/Dwarf/Types.hs                  |  24 +-
 compiler/nativeGen/PIC.hs                          | 174 ++++++-------
 compiler/nativeGen/PPC/Ppr.hs                      | 218 ++++++++--------
 compiler/nativeGen/PprBase.hs                      |   2 +-
 compiler/nativeGen/RegAlloc/Liveness.hs            |  15 +-
 compiler/nativeGen/SPARC/Ppr.hs                    |  72 +++---
 compiler/nativeGen/X86/Ppr.hs                      |  98 +++----
 compiler/parser/Lexer.x                            |   4 +-
 compiler/parser/Parser.y                           |   6 +-
 compiler/parser/RdrHsSyn.hs                        |  16 +-
 compiler/prelude/ForeignCall.hs                    |  16 +-
 compiler/prelude/PrelRules.hs                      |   2 +-
 compiler/profiling/CostCentre.hs                   |  10 +-
 compiler/profiling/ProfInit.hs                     |   8 +-
 compiler/rename/RnBinds.hs                         |  66 ++---
 compiler/rename/RnEnv.hs                           | 142 +++++-----
 compiler/rename/RnExpr.hs                          |  54 ++--
 compiler/rename/RnNames.hs                         | 100 +++----
 compiler/rename/RnPat.hs                           |  43 ++-
 compiler/rename/RnSource.hs                        |  46 ++--
 compiler/rename/RnSplice.hs                        |  16 +-
 compiler/rename/RnTypes.hs                         |  66 ++---
 compiler/simplCore/CoreMonad.hs                    |  64 ++---
 compiler/simplCore/FloatOut.hs                     |  13 +-
 compiler/simplCore/OccurAnal.hs                    |  17 +-
 compiler/simplCore/SAT.hs                          |  14 +-
 compiler/simplCore/SimplCore.hs                    |  15 +-
 compiler/simplCore/SimplEnv.hs                     |  21 +-
 compiler/simplCore/SimplMonad.hs                   |   8 +-
 compiler/simplCore/SimplUtils.hs                   |  31 ++-
 compiler/simplCore/Simplify.hs                     |   4 +-
 compiler/specialise/Rules.hs                       |  20 +-
 compiler/specialise/SpecConstr.hs                  |  30 +--
 compiler/specialise/Specialise.hs                  |  22 +-
 compiler/stgSyn/CoreToStg.hs                       |   6 +-
 compiler/stgSyn/StgLint.hs                         |  43 ++-
 compiler/stgSyn/StgSyn.hs                          |  56 ++--
 compiler/stranal/DmdAnal.hs                        |   7 +-
 compiler/stranal/WwLib.hs                          |   2 +-
 compiler/typecheck/FamInst.hs                      |   3 +-
 compiler/typecheck/FunDeps.hs                      |  27 +-
 compiler/typecheck/Inst.hs                         |  12 +-
 compiler/typecheck/TcAnnotations.hs                |  12 +-
 compiler/typecheck/TcArrows.hs                     |   9 +-
 compiler/typecheck/TcBinds.hs                      |  59 +++--
 compiler/typecheck/TcCanonical.hs                  |   5 +-
 compiler/typecheck/TcClassDcl.hs                   |  34 +--
 compiler/typecheck/TcDefaults.hs                   |  12 +-
 compiler/typecheck/TcDeriv.hs                      | 112 ++++----
 compiler/typecheck/TcEnv.hs                        |  26 +-
 compiler/typecheck/TcErrors.hs                     | 188 +++++++-------
 compiler/typecheck/TcEvidence.hs                   |  40 +--
 compiler/typecheck/TcExpr.hs                       |  74 +++---
 compiler/typecheck/TcFlatten.hs                    |   5 +-
 compiler/typecheck/TcForeign.hs                    |  20 +-
 compiler/typecheck/TcGenGenerics.hs                |   6 +-
 compiler/typecheck/TcHsType.hs                     |  46 ++--
 compiler/typecheck/TcInstDcls.hs                   |  54 ++--
 compiler/typecheck/TcInteract.hs                   |  53 ++--
 compiler/typecheck/TcMType.hs                      |   2 +-
 compiler/typecheck/TcMatches.hs                    |  13 +-
 compiler/typecheck/TcPat.hs                        |  21 +-
 compiler/typecheck/TcPatSyn.hs                     |  24 +-
 compiler/typecheck/TcRnDriver.hs                   |  72 +++---
 compiler/typecheck/TcRnMonad.hs                    |   8 +-
 compiler/typecheck/TcRnTypes.hs                    | 190 +++++++-------
 compiler/typecheck/TcRules.hs                      |   4 +-
 compiler/typecheck/TcSMonad.hs                     |  35 ++-
 compiler/typecheck/TcSimplify.hs                   |  41 ++-
 compiler/typecheck/TcSplice.hs                     |  30 +--
 compiler/typecheck/TcTyClsDecls.hs                 | 161 ++++++------
 compiler/typecheck/TcTyDecls.hs                    |  14 +-
 compiler/typecheck/TcType.hs                       |  86 +++---
 compiler/typecheck/TcUnify.hs                      |  18 +-
 compiler/typecheck/TcValidity.hs                   | 108 ++++----
 compiler/types/Class.hs                            |   7 +-
 compiler/types/Coercion.hs                         |  15 +-
 compiler/types/FamInstEnv.hs                       |  24 +-
 compiler/types/InstEnv.hs                          |  10 +-
 compiler/types/OptCoercion.hs                      |   3 +-
 compiler/types/TyCoRep.hs                          |  34 +--
 compiler/types/Type.hs                             |   4 +-
 compiler/utils/Outputable.hs                       |  92 +++----
 compiler/utils/UniqDFM.hs                          |   3 +-
 compiler/utils/UniqFM.hs                           |   3 +-
 .../vectorise/Vectorise/Builtins/Initialise.hs     |   4 +-
 compiler/vectorise/Vectorise/Exp.hs                |   5 +-
 compiler/vectorise/Vectorise/Monad/Global.hs       |  13 +-
 compiler/vectorise/Vectorise/Type/Env.hs           |   5 +-
 165 files changed, 2886 insertions(+), 2929 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f02fefd3187beed98444273e5fbc2c022af5efbc


More information about the ghc-commits mailing list