summaryrefslogtreecommitdiff
path: root/compiler/GHC/Utils/Panic.hs
Commit message (Collapse)AuthorAgeFilesLines
* Avoid unsafePerformIO for getProgNameSylvain Henry2021-07-091-4/+1
| | | | | | | | getProgName was used to append the name of the program (e.g. "ghc") to printed error messages in the Show instance of GhcException. It doesn't belong here as GHCi and GHC API users may want to override this behavior by setting a different error handler. So we now call it in the defaultErrorHandler instead.
* Put tracing functions into their own moduleSylvain Henry2021-06-221-2/+0
| | | | | | | | Now that Outputable is independent of DynFlags, we can put tracing functions using SDocs into their own module that doesn't transitively depend on any GHC.Driver.* module. A few modules needed to be moved to avoid loops in DEBUG mode.
* Remove useless {-# LANGUAGE CPP #-} pragmasSylvain Henry2021-05-121-1/+2
|
* Replace CPP assertions with Haskell functionsSylvain Henry2021-05-121-3/+22
| | | | | | | | | | | | | | | There is no reason to use CPP. __LINE__ and __FILE__ macros are now better replaced with GHC's CallStack. As a bonus, assert error messages now contain more information (function name, column). Here is the mapping table (HasCallStack omitted): * ASSERT: assert :: Bool -> a -> a * MASSERT: massert :: Bool -> m () * ASSERTM: assertM :: m Bool -> m () * ASSERT2: assertPpr :: Bool -> SDoc -> a -> a * MASSERT2: massertPpr :: Bool -> SDoc -> m () * ASSERTM2: assertPprM :: m Bool -> SDoc -> m ()
* Remove unsafeGlobalDynFlags (#17957, #14597)Sylvain Henry2020-09-301-12/+8
| | | | | There are still global variables but only 3 booleans instead of a single DynFlags.
* DynFlags: disentangle OutputableSylvain Henry2020-08-121-29/+73
| | | | | | | | | - put panic related functions into GHC.Utils.Panic - put trace related functions using DynFlags in GHC.Driver.Ppr One step closer making Outputable fully independent of DynFlags. Bump haddock submodule
* Clean up haddock hyperlinks of GHC.* (part2)Takenobu Tani2020-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This updates haddock comments only. This patch focuses to update for hyperlinks in GHC API's haddock comments, because broken links especially discourage newcomers. This includes the following hierarchies: - GHC.Iface.* - GHC.Llvm.* - GHC.Rename.* - GHC.Tc.* - GHC.HsToCore.* - GHC.StgToCmm.* - GHC.CmmToAsm.* - GHC.Runtime.* - GHC.Unit.* - GHC.Utils.* - GHC.SysTools.*
* Remove custom ExceptionMonad class (#18075) (updating haddock submodule ↵Artem Pelenitsyn2020-05-041-3/+4
| | | | accordingly)
* Modules: Utils and Data (#13009)Sylvain Henry2020-04-261-0/+259
Update Haddock submodule Metric Increase: haddock.compiler