summaryrefslogtreecommitdiff
path: root/ghc/compiler/basicTypes/Name.lhs
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-11-10 15:12:55 +0000
committersimonpj <unknown>2000-11-10 15:12:55 +0000
commitf23ba2b294429ccbdeb80f0344ec08f6abf61bb7 (patch)
tree30e94ffff421c99ae25f35759e52b7e267e9e8af /ghc/compiler/basicTypes/Name.lhs
parent6bd12a0cb5115d08a9ee84dbc1920e83bb7c1616 (diff)
downloadhaskell-f23ba2b294429ccbdeb80f0344ec08f6abf61bb7.tar.gz
[project @ 2000-11-10 15:12:50 by simonpj]
1. Outputable.PprStyle now carries a bit more information In particular, the printing style tells whether to print a name in unqualified form. This used to be embedded in a Name, but since Names now outlive a single compilation unit, that's no longer appropriate. So now the print-unqualified predicate is passed in the printing style, not embedded in the Name. 2. I tidied up HscMain a little. Many of the showPass messages have migraged into the repective pass drivers
Diffstat (limited to 'ghc/compiler/basicTypes/Name.lhs')
-rw-r--r--ghc/compiler/basicTypes/Name.lhs19
1 files changed, 8 insertions, 11 deletions
diff --git a/ghc/compiler/basicTypes/Name.lhs b/ghc/compiler/basicTypes/Name.lhs
index 5888124fc3..dcf672e5d4 100644
--- a/ghc/compiler/basicTypes/Name.lhs
+++ b/ghc/compiler/basicTypes/Name.lhs
@@ -43,8 +43,7 @@ module Name (
#include "HsVersions.h"
import OccName -- All of it
-import Module ( Module, moduleName, mkVanillaModule,
- printModulePrefix, isModuleInThisPackage )
+import Module ( Module, moduleName, mkVanillaModule, isModuleInThisPackage )
import RdrName ( RdrName, mkRdrOrig, mkRdrUnqual, rdrNameOcc, rdrNameModule )
import CmdLineOpts ( opt_Static, opt_OmitInterfacePragmas, opt_EnsureSplittableC )
import SrcLoc ( builtinSrcLoc, noSrcLoc, SrcLoc )
@@ -456,10 +455,10 @@ instance Outputable Name where
-- When printing interfaces, all Locals have been given nice print-names
ppr name = pprName name
-pprName (Name {n_sort = sort, n_uniq = uniq, n_occ = occ})
+pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ})
= getPprStyle $ \ sty ->
case sort of
- Global mod -> pprGlobal sty uniq mod occ
+ Global mod -> pprGlobal sty name uniq mod occ
System -> pprSysLocal sty uniq occ
Local -> pprLocal sty uniq occ empty
Exported -> pprLocal sty uniq occ (char 'x')
@@ -470,16 +469,14 @@ pprLocal sty uniq occ pp_export
text "{-" <> pp_export <+> pprUnique10 uniq <> text "-}"
| otherwise = pprOccName occ
-pprGlobal sty uniq mod occ
- | codeStyle sty = ppr (moduleName mod) <> char '_' <> pprOccName occ
+pprGlobal sty name uniq mod occ
+ | codeStyle sty = ppr (moduleName mod) <> char '_' <> pprOccName occ
- | debugStyle sty = ppr (moduleName mod) <> dot <> pprOccName occ <>
+ | debugStyle sty = ppr (moduleName mod) <> dot <> pprOccName occ <>
text "{-" <> pprUnique10 uniq <> text "-}"
- | ifaceStyle sty
- || printModulePrefix mod = ppr (moduleName mod) <> dot <> pprOccName occ
-
- | otherwise = pprOccName occ
+ | unqualStyle sty name = pprOccName occ
+ | otherwise = ppr (moduleName mod) <> dot <> pprOccName occ
pprSysLocal sty uniq occ
| codeStyle sty = pprUnique uniq