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/ghci/Linker.hs | |
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/ghci/Linker.hs')
-rw-r--r-- | compiler/ghci/Linker.hs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs index 44d272ec23..982b4fc148 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/ghci/Linker.hs @@ -546,22 +546,22 @@ normalObjectSuffix = phaseInputExt StopLn failNonStd :: DynFlags -> SrcSpan -> IO (Maybe FilePath) failNonStd dflags srcspan = dieWith dflags srcspan $ - ptext (sLit "Cannot load") <+> compWay <+> - ptext (sLit "objects when GHC is built") <+> ghciWay $$ - ptext (sLit "To fix this, either:") $$ - ptext (sLit " (1) Use -fexternal-interprter, or") $$ - ptext (sLit " (2) Build the program twice: once") <+> - ghciWay <> ptext (sLit ", and then") $$ - ptext (sLit " with") <+> compWay <+> - ptext (sLit "using -osuf to set a different object file suffix.") + text "Cannot load" <+> compWay <+> + text "objects when GHC is built" <+> ghciWay $$ + text "To fix this, either:" $$ + text " (1) Use -fexternal-interprter, or" $$ + text " (2) Build the program twice: once" <+> + ghciWay <> text ", and then" $$ + text " with" <+> compWay <+> + text "using -osuf to set a different object file suffix." where compWay - | WayDyn `elem` ways dflags = ptext (sLit "-dynamic") - | WayProf `elem` ways dflags = ptext (sLit "-prof") - | otherwise = ptext (sLit "normal") + | WayDyn `elem` ways dflags = text "-dynamic" + | WayProf `elem` ways dflags = text "-prof" + | otherwise = text "normal" ghciWay - | dynamicGhc = ptext (sLit "with -dynamic") - | rtsIsProfiled = ptext (sLit "with -prof") - | otherwise = ptext (sLit "the normal way") + | dynamicGhc = text "with -dynamic" + | rtsIsProfiled = text "with -prof" + | otherwise = text "the normal way" getLinkDeps :: HscEnv -> HomePackageTable -> PersistentLinkerState @@ -649,11 +649,11 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods no_obj :: Outputable a => a -> IO b no_obj mod = dieWith dflags span $ - ptext (sLit "cannot find object file for module ") <> + text "cannot find object file for module " <> quotes (ppr mod) $$ while_linking_expr - while_linking_expr = ptext (sLit "while linking an interpreted expression") + while_linking_expr = text "while linking an interpreted expression" -- This one is a build-system bug @@ -691,7 +691,7 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods ok <- doesFileExist new_file if (not ok) then dieWith dflags span $ - ptext (sLit "cannot find object file ") + text "cannot find object file " <> quotes (text new_file) $$ while_linking_expr else return (DotO new_file) adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) |