diff options
author | Sven Tennie <sven.tennie@gmail.com> | 2021-09-23 11:44:52 +0200 |
---|---|---|
committer | Sven Tennie <sven.tennie@gmail.com> | 2021-09-23 11:44:52 +0200 |
commit | 6a15425cc769032ad30adc3122c6e356a5e2e764 (patch) | |
tree | dc95a14204f5421feaf16dfb3f289b22a5b39406 | |
parent | b3ab7a1c9ffeb2808a7930e7bb0910a96454837f (diff) | |
download | haskell-wip/T18159.tar.gz |
Minimize diffwip/T18159
-rw-r--r-- | compiler/GHC/Runtime/Debugger.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Interpreter.hs | 17 | ||||
-rw-r--r-- | compiler/GHC/SysTools/Process.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/SysTools/Tasks.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Utils/Panic.hs | 4 | ||||
-rw-r--r-- | ghc/GHCi/UI.hs | 2 | ||||
-rw-r--r-- | ghc/GHCi/UI/Info.hs | 2 | ||||
-rw-r--r-- | libraries/base/Control/Exception/Base.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/IO.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/IO/Handle.hs | 2 | ||||
-rw-r--r-- | libraries/ghci/GHCi/Run.hs | 2 |
11 files changed, 6 insertions, 39 deletions
diff --git a/compiler/GHC/Runtime/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs index f6f0036f18..2209805e75 100644 --- a/compiler/GHC/Runtime/Debugger.hs +++ b/compiler/GHC/Runtime/Debugger.hs @@ -265,10 +265,6 @@ pprTypeAndContents id = do docs_term <- case e_term of Right term -> showTerm term Left exn -> return (text "*** Exception:" <+> -#if __GLASGOW_HASKELL__ >= 903 - text (show (exn :: SomeExceptionWithLocation))) -#else text (show (exn :: SomeException))) -#endif return $ pprdId <+> equals <+> docs_term else return pprdId diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs index c164930c9f..fe7a1b1185 100644 --- a/compiler/GHC/Runtime/Interpreter.hs +++ b/compiler/GHC/Runtime/Interpreter.hs @@ -536,36 +536,19 @@ findSystemLibrary interp str = interpCmd interp (FindSystemLibrary str) iservCall :: Binary a => IServInstance -> Message a -> IO a iservCall iserv msg = remoteCall (iservPipe iserv) msg - -- TODO: Use SomeExceptionWithLocation? -#if __GLASGOW_HASKELL__ >= 903 - `catchException` \(e :: SomeExceptionWithLocation) -> handleIServFailure iserv e -#else `catchException` \(e :: SomeException) -> handleIServFailure iserv e -#endif -- | Read a value from the iserv process readIServ :: IServInstance -> Get a -> IO a readIServ iserv get = readPipe (iservPipe iserv) get -#if __GLASGOW_HASKELL__ >= 903 - `catchException` \(e :: SomeExceptionWithLocation) -> handleIServFailure iserv e -#else `catchException` \(e :: SomeException) -> handleIServFailure iserv e -#endif -- | Send a value to the iserv process writeIServ :: IServInstance -> Put -> IO () writeIServ iserv put = writePipe (iservPipe iserv) put -#if __GLASGOW_HASKELL__ >= 903 - `catchException` \(e :: SomeExceptionWithLocation) -> handleIServFailure iserv e -#else `catchException` \(e :: SomeException) -> handleIServFailure iserv e -#endif -#if __GLASGOW_HASKELL__ >= 903 -handleIServFailure :: IServInstance -> SomeExceptionWithLocation -> IO a -#else handleIServFailure :: IServInstance -> SomeException -> IO a -#endif handleIServFailure iserv e = do let proc = iservProcess iserv ex <- getProcessExitCode proc diff --git a/compiler/GHC/SysTools/Process.hs b/compiler/GHC/SysTools/Process.hs index 564670040a..d7b340ab20 100644 --- a/compiler/GHC/SysTools/Process.hs +++ b/compiler/GHC/SysTools/Process.hs @@ -63,11 +63,7 @@ readCreateProcessWithExitCode' proc = do -- fork off a thread to start consuming the output outMVar <- newEmptyMVar -#if __GLASGOW_HASKELL__ >= 903 - let onError :: SomeExceptionWithLocation -> IO () -#else let onError :: SomeException -> IO () -#endif onError exc = putMVar outMVar (Left exc) _ <- forkIO $ handle onError $ do output <- hGetContents' outh diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs index 054a573bfb..e0ea398ddc 100644 --- a/compiler/GHC/SysTools/Tasks.hs +++ b/compiler/GHC/SysTools/Tasks.hs @@ -195,11 +195,7 @@ runClang logger dflags args = traceToolCommand logger "clang" $ do mb_env <- getGccEnv args2 catchException (runSomethingFiltered logger id "Clang (Assembler)" clang args2 Nothing mb_env) -#if __GLASGOW_HASKELL__ >= 903 - (\(err :: SomeExceptionWithLocation) -> do -#else (\(err :: SomeException) -> do -#endif errorMsg logger $ text ("Error running clang! you need clang installed to use the" ++ " LLVM backend") $+$ diff --git a/compiler/GHC/Utils/Panic.hs b/compiler/GHC/Utils/Panic.hs index f337809426..badaee326a 100644 --- a/compiler/GHC/Utils/Panic.hs +++ b/compiler/GHC/Utils/Panic.hs @@ -141,11 +141,7 @@ safeShowException e = do r <- try (return $! forceList (showException e)) case r of Right msg -> return msg -#if __GLASGOW_HASKELL__ >= 903 - Left e' -> safeShowException (e' :: SomeExceptionWithLocation) -#else Left e' -> safeShowException (e' :: SomeException) -#endif where forceList [] = [] forceList xs@(x : xt) = x `seq` forceList xt `seq` xs diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 837bfdb076..fe46d2df63 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -4031,7 +4031,7 @@ breakById inp = do let (mod_str, top_level, fun_str) = splitIdent inp mod_top_lvl = combineModIdent mod_str top_level mb_mod <- catch (lookupModuleInscope mod_top_lvl) - (\(_ :: SomeExceptionWithLocation) -> lookupModuleInGraph mod_str) + (\(_ :: SomeException) -> lookupModuleInGraph mod_str) -- If the top-level name is not in scope, `lookupModuleInscope` will -- throw an exception, then lookup the module name in the module graph. mb_err_msg <- validateBP mod_str fun_str mb_mod diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs index f793c20374..7fb13316e9 100644 --- a/ghc/GHCi/UI/Info.hs +++ b/ghc/GHCi/UI/Info.hs @@ -276,7 +276,7 @@ collectInfo ms loaded = do where go df unit_state m name = do { info <- getModInfo name; return (M.insert name info m) } `MC.catch` - (\(e :: SomeExceptionWithLocation) -> do + (\(e :: SomeException) -> do liftIO $ putStrLn $ showSDocForUser df unit_state alwaysQualify $ "Error while getting type info from" <+> diff --git a/libraries/base/Control/Exception/Base.hs b/libraries/base/Control/Exception/Base.hs index a90815d28f..c25caea7dc 100644 --- a/libraries/base/Control/Exception/Base.hs +++ b/libraries/base/Control/Exception/Base.hs @@ -191,7 +191,7 @@ tryJust p a = do -- exception raised by the computation. onException :: IO a -> IO b -> IO a onException io what = io `catch` \e -> do _ <- what - throwIO (e :: SomeExceptionWithLocation) + throwIO (e :: SomeException) ----------------------------------------------------------------------------- -- Some Useful Functions diff --git a/libraries/base/GHC/IO.hs b/libraries/base/GHC/IO.hs index 6c5a208338..7332e119b5 100644 --- a/libraries/base/GHC/IO.hs +++ b/libraries/base/GHC/IO.hs @@ -298,7 +298,7 @@ getMaskingState = IO $ \s -> onException :: IO a -> IO b -> IO a onException io what = io `catchException` \e -> do _ <- what - throwIO (e :: SomeExceptionWithLocation) + throwIO (e :: SomeException) -- | Executes an IO computation with asynchronous -- exceptions /masked/. That is, any thread which attempts to raise diff --git a/libraries/base/GHC/IO/Handle.hs b/libraries/base/GHC/IO/Handle.hs index 690b971c04..3efe254839 100644 --- a/libraries/base/GHC/IO/Handle.hs +++ b/libraries/base/GHC/IO/Handle.hs @@ -701,7 +701,7 @@ hDuplicateTo h1 _ = ioe_dupHandlesNotCompatible h1 try :: IO () -> IO () -try io = io `catchException` (const (pure ()) :: SomeExceptionWithLocation -> IO ()) +try io = io `catchException` (const (pure ()) :: SomeException -> IO ()) ioe_dupHandlesNotCompatible :: Handle -> IO a ioe_dupHandlesNotCompatible h = diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs index ad062672e0..4ecb64620a 100644 --- a/libraries/ghci/GHCi/Run.hs +++ b/libraries/ghci/GHCi/Run.hs @@ -246,7 +246,7 @@ redirectInterrupts target wait = do m <- deRefWeak wtid case m of Nothing -> wait - Just target -> do throwTo target (e :: SomeExceptionWithLocation); wait + Just target -> do throwTo target (e :: SomeException); wait measureAlloc :: IO (EvalResult a) -> IO (EvalStatus a) measureAlloc io = do |