summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-05-06 22:22:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-12 21:41:44 -0400
commit0ef119071347f7bc14f0fa89904b0cfd0b230ac1 (patch)
tree7a80b3942ae6bd18391f9b924ad55bb001392288 /ghc
parentbfabf94f63b6644bd32982fd13ea0c8bca9aeae4 (diff)
downloadhaskell-0ef119071347f7bc14f0fa89904b0cfd0b230ac1.tar.gz
Fully remove HsVersions.h
Replace uses of WARN macro with calls to: warnPprTrace :: Bool -> SDoc -> a -> a Remove the now unused HsVersions.h Bump haddock submodule
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs13
-rw-r--r--ghc/GHCi/UI/Monad.hs2
2 files changed, 6 insertions, 9 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 0b5076e390..8dfe49303d 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -30,8 +30,6 @@ module GHCi.UI (
ghciWelcomeMsg
) where
-#include "HsVersions.h"
-
-- GHCi
import qualified GHCi.UI.Monad as GhciMonad ( args, runStmt, runDecls' )
import GHCi.UI.Monad hiding ( args, runStmt )
@@ -99,6 +97,7 @@ import qualified GHC.Linker.Loader as Loader
import GHC.Data.Maybe ( orElse, expectJust )
import GHC.Types.Name.Set
import GHC.Utils.Panic hiding ( showException, try )
+import GHC.Utils.Panic.Plain
import GHC.Utils.Misc
import qualified GHC.LanguageExtensions as LangExt
import GHC.Data.Bag (unitBag)
@@ -1833,7 +1832,7 @@ checkModule m = do
case GHC.moduleInfo r of
cm | Just scope <- GHC.modInfoTopLevelScope cm ->
let
- (loc, glob) = ASSERT( all isExternalName scope )
+ (loc, glob) = assert (all isExternalName scope) $
partition ((== modl) . GHC.moduleName . GHC.nameModule) scope
in
(text "global names: " <+> ppr glob) $$
@@ -2568,7 +2567,7 @@ browseModule bang modl exports_only = do
-- identifiers first. We would like to improve this; see #1799.
sorted_names = loc_sort local ++ occ_sort external
where
- (local,external) = ASSERT( all isExternalName names )
+ (local,external) = assert (all isExternalName names) $
partition ((==modl) . nameModule) names
occ_sort = sortBy (compare `on` nameOccName)
-- try to sort by src location. If the first name in our list
@@ -3764,7 +3763,7 @@ enclosingTickSpan _ (UnhelpfulSpan _) = panic "enclosingTickSpan UnhelpfulSpan"
enclosingTickSpan md (RealSrcSpan src _) = do
ticks <- getTickArray md
let line = srcSpanStartLine src
- ASSERT(inRange (bounds ticks) line) do
+ massert (inRange (bounds ticks) line)
let enclosing_spans = [ pan | (_,pan) <- ticks ! line
, realSrcSpanEnd pan >= realSrcSpanEnd src]
return . head . sortBy leftmostLargestRealSrcSpan $ enclosing_spans
@@ -4250,7 +4249,7 @@ list2 [arg] = do
let loc = GHC.srcSpanStart (GHC.nameSrcSpan name)
case loc of
RealSrcLoc l _ ->
- do tickArray <- ASSERT( isExternalName name )
+ do tickArray <- assert (isExternalName name) $
getTickArray (GHC.nameModule name)
let mb_span = findBreakByCoord (Just (GHC.srcLocFile l))
(GHC.srcLocLine l, GHC.srcLocCol l)
@@ -4552,7 +4551,7 @@ wantNameFromInterpretedModule noCanDo str and_then =
case names of
[] -> return ()
(n:_) -> do
- let modl = ASSERT( isExternalName n ) GHC.nameModule n
+ let modl = assert (isExternalName n) $ GHC.nameModule n
if not (GHC.isExternalName n)
then noCanDo n $ ppr n <>
text " is not defined in an interpreted module"
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs
index 11d575524f..ee6fa2f750 100644
--- a/ghc/GHCi/UI/Monad.hs
+++ b/ghc/GHCi/UI/Monad.hs
@@ -35,8 +35,6 @@ module GHCi.UI.Monad (
mkEvalWrapper
) where
-#include "HsVersions.h"
-
import GHCi.UI.Info (ModInfo)
import qualified GHC
import GHC.Driver.Monad hiding (liftIO)