summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-05-06 16:07:32 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-12 21:41:43 -0400
commitda56ed41b62ab132db6d62637c11076985410b24 (patch)
tree05f3930ae630e4e90a44021419943d8ccee8ead4 /compiler/GHC
parentf78c25da05849797dab684a221923aeac244c69b (diff)
downloadhaskell-da56ed41b62ab132db6d62637c11076985410b24.tar.gz
Ensure assert from Control.Exception isn't used
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/CmmToAsm.hs5
-rw-r--r--compiler/GHC/CmmToLlvm/Mangler.hs2
-rw-r--r--compiler/GHC/Data/StringBuffer.hs4
-rw-r--r--compiler/GHC/Driver/CodeOutput.hs2
-rw-r--r--compiler/GHC/Driver/Make.hs3
-rw-r--r--compiler/GHC/StgToByteCode.hs2
-rw-r--r--compiler/GHC/SysTools/Terminal.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Splice.hs2
-rw-r--r--compiler/GHC/Types/Literal.hs1
-rw-r--r--compiler/GHC/Utils/Exception.hs2
10 files changed, 12 insertions, 13 deletions
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs
index 6712db8d05..c4a7ebacd4 100644
--- a/compiler/GHC/CmmToAsm.hs
+++ b/compiler/GHC/CmmToAsm.hs
@@ -134,9 +134,11 @@ import qualified GHC.Utils.Ppr as Pretty
import GHC.Utils.BufHandle
import GHC.Utils.Outputable as Outputable
import GHC.Utils.Panic
+import GHC.Utils.Error
+import GHC.Utils.Exception (evaluate)
+
import GHC.Data.FastString
import GHC.Types.Unique.Set
-import GHC.Utils.Error
import GHC.Unit
import GHC.Data.Stream (Stream)
import qualified GHC.Data.Stream as Stream
@@ -144,7 +146,6 @@ import qualified GHC.Data.Stream as Stream
import Data.List (sortBy, groupBy)
import Data.Maybe
import Data.Ord ( comparing )
-import Control.Exception
import Control.Monad
import System.IO
diff --git a/compiler/GHC/CmmToLlvm/Mangler.hs b/compiler/GHC/CmmToLlvm/Mangler.hs
index 4313294294..fb052ce333 100644
--- a/compiler/GHC/CmmToLlvm/Mangler.hs
+++ b/compiler/GHC/CmmToLlvm/Mangler.hs
@@ -18,8 +18,8 @@ import GHC.Platform ( platformArch, Arch(..) )
import GHC.Utils.Error ( withTiming )
import GHC.Utils.Outputable ( text )
import GHC.Utils.Logger
+import GHC.Utils.Exception (try)
-import Control.Exception
import qualified Data.ByteString.Char8 as B
import System.IO
diff --git a/compiler/GHC/Data/StringBuffer.hs b/compiler/GHC/Data/StringBuffer.hs
index 1f01451971..0de4b007ba 100644
--- a/compiler/GHC/Data/StringBuffer.hs
+++ b/compiler/GHC/Data/StringBuffer.hs
@@ -52,14 +52,14 @@ module GHC.Data.StringBuffer
import GHC.Prelude
-import GHC.Utils.Encoding
import GHC.Data.FastString
+import GHC.Utils.Encoding
import GHC.Utils.IO.Unsafe
import GHC.Utils.Panic.Plain
import GHC.Utils.Misc
+import GHC.Utils.Exception ( bracket_ )
import Data.Maybe
-import Control.Exception
import System.IO
import System.IO.Unsafe ( unsafePerformIO )
import GHC.IO.Encoding.UTF8 ( mkUTF8 )
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs
index 60513c9b82..2f028f9c7f 100644
--- a/compiler/GHC/Driver/CodeOutput.hs
+++ b/compiler/GHC/Driver/CodeOutput.hs
@@ -43,6 +43,7 @@ import GHC.Utils.Error
import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Utils.Logger
+import GHC.Utils.Exception (bracket)
import GHC.Unit
import GHC.Unit.State
@@ -53,7 +54,6 @@ import GHC.Types.CostCentre
import GHC.Types.ForeignStubs
import GHC.Types.Unique.Supply ( mkSplitUniqSupply )
-import Control.Exception
import System.Directory
import System.FilePath
import System.IO
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 51110e4134..654ba697a1 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -78,7 +78,7 @@ import GHC.Data.Maybe ( expectJust )
import GHC.Data.StringBuffer
import qualified GHC.LanguageExtensions as LangExt
-import GHC.Utils.Exception ( tryIO )
+import GHC.Utils.Exception ( tryIO, AsyncException(..), evaluate )
import GHC.Utils.Monad ( allM )
import GHC.Utils.Outputable
import GHC.Utils.Panic
@@ -119,7 +119,6 @@ import Control.Concurrent ( forkIOWithUnmask, killThread )
import qualified GHC.Conc as CC
import Control.Concurrent.MVar
import Control.Concurrent.QSem
-import Control.Exception
import Control.Monad
import Control.Monad.Trans.Except ( ExceptT(..), runExceptT, throwE )
import qualified Control.Monad.Catch as MC
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs
index 787c0ad155..b6e71df36a 100644
--- a/compiler/GHC/StgToByteCode.hs
+++ b/compiler/GHC/StgToByteCode.hs
@@ -60,6 +60,7 @@ import GHC.Builtin.Uniques
import GHC.Builtin.Utils ( primOpId )
import GHC.Data.FastString
import GHC.Utils.Panic
+import GHC.Utils.Exception (evaluate)
import GHC.StgToCmm.Closure ( NonVoid(..), fromNonVoid, nonVoidIds )
import GHC.StgToCmm.Layout
import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes)
@@ -78,7 +79,6 @@ import Data.Char
import GHC.Types.Unique.Supply
import GHC.Unit.Module
-import Control.Exception
import Data.Array
import Data.Coerce (coerce)
import Data.ByteString (ByteString)
diff --git a/compiler/GHC/SysTools/Terminal.hs b/compiler/GHC/SysTools/Terminal.hs
index 1c04e21c34..37f53772ef 100644
--- a/compiler/GHC/SysTools/Terminal.hs
+++ b/compiler/GHC/SysTools/Terminal.hs
@@ -11,7 +11,7 @@ import System.Console.Terminfo (SetupTermError, Terminal, getCapability,
setupTermFromEnv, termColors)
import System.Posix (queryTerminal, stdError)
#elif defined(mingw32_HOST_OS)
-import Control.Exception (try)
+import GHC.Utils.Exception (try)
-- import Data.Bits ((.|.), (.&.))
import Foreign (Ptr, peek, with)
import qualified Graphics.Win32 as Win32
diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs
index 58f8e59b37..8a6c4399e7 100644
--- a/compiler/GHC/Tc/Gen/Splice.hs
+++ b/compiler/GHC/Tc/Gen/Splice.hs
@@ -123,6 +123,7 @@ import GHC.Utils.Panic as Panic
import GHC.Utils.Lexeme
import GHC.Utils.Outputable
import GHC.Utils.Logger
+import GHC.Utils.Exception (throwIO, ErrorCall(..))
import GHC.Utils.TmpFs ( newTempName, TempFileLifetime(..) )
@@ -141,7 +142,6 @@ import Unsafe.Coerce ( unsafeCoerce )
#endif
import Control.Monad
-import Control.Exception
import Data.Binary
import Data.Binary.Get
import Data.List ( find )
diff --git a/compiler/GHC/Types/Literal.hs b/compiler/GHC/Types/Literal.hs
index 3d41444848..d2446b9fe5 100644
--- a/compiler/GHC/Types/Literal.hs
+++ b/compiler/GHC/Types/Literal.hs
@@ -77,7 +77,6 @@ import GHC.Types.Basic
import GHC.Utils.Binary
import GHC.Settings.Constants
import GHC.Platform
-import GHC.Utils.Misc
import GHC.Utils.Panic
import Data.ByteString (ByteString)
diff --git a/compiler/GHC/Utils/Exception.hs b/compiler/GHC/Utils/Exception.hs
index 4d3c777932..b07baa4625 100644
--- a/compiler/GHC/Utils/Exception.hs
+++ b/compiler/GHC/Utils/Exception.hs
@@ -11,7 +11,7 @@ module GHC.Utils.Exception
import GHC.Prelude
import GHC.IO (catchException)
-import Control.Exception as CE
+import Control.Exception as CE hiding (assert)
import Control.Monad.IO.Class
import Control.Monad.Catch