diff options
-rw-r--r-- | compiler/GHC/StgToJS/Linker/Linker.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/StgToJS/Object.hs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/GHC/StgToJS/Linker/Linker.hs b/compiler/GHC/StgToJS/Linker/Linker.hs index 30071d7d83..ad3fabdadc 100644 --- a/compiler/GHC/StgToJS/Linker/Linker.hs +++ b/compiler/GHC/StgToJS/Linker/Linker.hs @@ -485,7 +485,7 @@ getDeps loaded_deps base fun startlu = go' S.empty (S.fromList startlu) (S.toLis Nothing -> pprPanic "getDeps.go': object file not loaded for: " $ pprModule key Just (Deps _m _r e _b) -> let lun :: Int - lun = fromMaybe (pprPanic "exported function not found: " $ pprModule key) + lun = fromMaybe (pprPanic "exported function not found: " $ ppr f) (M.lookup f e) lu = (key, lun) in go' result (addOpen result open [lu]) fs diff --git a/compiler/GHC/StgToJS/Object.hs b/compiler/GHC/StgToJS/Object.hs index 11e62e2eb1..a7d79d6a7b 100644 --- a/compiler/GHC/StgToJS/Object.hs +++ b/compiler/GHC/StgToJS/Object.hs @@ -124,6 +124,7 @@ import GHC.Data.FastString import GHC.Data.ShortText as ST import GHC.Utils.Misc +import GHC.Utils.Outputable (ppr, Outputable, hcat, vcat, text) data Header = Header { hdrModuleName :: !BS.ByteString @@ -194,6 +195,12 @@ data ExportedFun = ExportedFun , funSymbol :: !ShortText } deriving (Eq, Ord) +instance Outputable ExportedFun where + ppr (ExportedFun m f) = vcat + [ hcat [ text "module: ", pprModule m ] + , hcat [ text "symbol: ", ppr f ] + ] + -- we need to store the size separately, since getting a HashMap's size is O(n) data SymbolTable = SymbolTable !Int !(Map ShortText Int) |