Commit cf1d9751 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Austin Seipp

Don't repeat package key with -dppr-debug when package info is missing.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D802
parent ab76b099
......@@ -326,11 +326,13 @@ stablePackageKeyCmp p1 p2 = packageKeyFS p1 `compare` packageKeyFS p2
instance Outputable PackageKey where
ppr pk = getPprStyle $ \sty -> sdocWithDynFlags $ \dflags ->
text (packageKeyPackageIdString dflags pk)
-- Don't bother qualifying if it's wired in!
<> (if qualPackage sty pk && not (pk `elem` wiredInPackageKeys)
then char '@' <> ftext (packageKeyFS pk)
else empty)
case packageKeyPackageIdString dflags pk of
Nothing -> ftext (packageKeyFS pk)
Just pkg -> text pkg
-- Don't bother qualifying if it's wired in!
<> (if qualPackage sty pk && not (pk `elem` wiredInPackageKeys)
then char '@' <> ftext (packageKeyFS pk)
else empty)
instance Binary PackageKey where
put_ bh pid = put_ bh (packageKeyFS pid)
......
......@@ -1354,12 +1354,10 @@ missingDependencyMsg (Just parent)
-- -----------------------------------------------------------------------------
packageKeyPackageIdString :: DynFlags -> PackageKey -> String
packageKeyPackageIdString :: DynFlags -> PackageKey -> Maybe String
packageKeyPackageIdString dflags pkg_key
| pkg_key == mainPackageKey = "main"
| otherwise = maybe "(unknown)"
sourcePackageIdString
(lookupPackage dflags pkg_key)
| pkg_key == mainPackageKey = Just "main"
| otherwise = fmap sourcePackageIdString (lookupPackage dflags pkg_key)
-- | Will the 'Name' come from a dynamically linked library?
isDllName :: DynFlags -> PackageKey -> Module -> Name -> Bool
......
......@@ -3,4 +3,4 @@ module Packages where
import {-# SOURCE #-} Module (PackageKey)
import {-# SOURCE #-} DynFlags (DynFlags)
data PackageState
packageKeyPackageIdString :: DynFlags -> PackageKey -> String
packageKeyPackageIdString :: DynFlags -> PackageKey -> Maybe String
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment