Simon Hengel pushed to branch wip/sol/hie-wierd-in-as-external at Glasgow Haskell Compiler / GHC
Commits:
-
9815908e
by Simon Hengel at 2025-07-30T11:43:53+07:00
-
9909605a
by Simon Hengel at 2025-07-30T11:43:53+07:00
2 changed files:
Changes:
| ... | ... | @@ -100,9 +100,14 @@ OrigNameCache at all? Good question; after all, |
| 100 | 100 | 3) Loading of interface files encodes names via Uniques, as detailed in
|
| 101 | 101 | Note [Symbol table representation of names] in GHC.Iface.Binary
|
| 102 | 102 | |
| 103 | -It turns out that we end up looking up built-in syntax in the cache when we
|
|
| 104 | -generate Haddock documentation. E.g. if we don't find tuple data constructors
|
|
| 105 | -there, hyperlinks won't work as expected. Test case: haddockHtmlTest (Bug923.hs)
|
|
| 103 | + |
|
| 104 | +However note that:
|
|
| 105 | + 1) It turns out that we end up looking up built-in syntax in the cache when
|
|
| 106 | + we generate Haddock documentation. E.g. if we don't find tuple data
|
|
| 107 | + constructors there, hyperlinks won't work as expected. Test case:
|
|
| 108 | + haddockHtmlTest (Bug923.hs)
|
|
| 109 | + 2) HIE de-serialization relies on built-in names being present in the
|
|
| 110 | + knownKeysOrigNameCache.
|
|
| 106 | 111 | -}
|
| 107 | 112 | |
| 108 | 113 | -- | The NameCache makes sure that there is just one Unique assigned for
|
| ... | ... | @@ -25,9 +25,6 @@ import GHC.Iface.Ext.Utils |
| 25 | 25 | import GHC.Driver.Session
|
| 26 | 26 | import GHC.SysTools
|
| 27 | 27 | |
| 28 | -makeNc :: IO NameCache
|
|
| 29 | -makeNc = initNameCache 'z' []
|
|
| 30 | - |
|
| 31 | 28 | dynFlagsForPrinting :: String -> IO DynFlags
|
| 32 | 29 | dynFlagsForPrinting libdir = do
|
| 33 | 30 | systemSettings <- initSysTools libdir
|
| ... | ... | @@ -37,7 +34,7 @@ readTestHie :: FilePath -> IO (DynFlags, HieFile) |
| 37 | 34 | readTestHie fp = do
|
| 38 | 35 | libdir:_ <- getArgs
|
| 39 | 36 | df <- dynFlagsForPrinting libdir
|
| 40 | - nc <- makeNc
|
|
| 37 | + nc <- newNameCache 'r' knownKeysOrigNameCache
|
|
| 41 | 38 | hfr <- readHieFile nc fp
|
| 42 | 39 | pure (df, hie_file_result hfr)
|
| 43 | 40 |