From d9dfbde30aa11afc87f25b73dc2d154a46ca24d4 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 14 Mar 2019 15:47:44 -0700 Subject: Add PlainPanic for throwing exceptions without depending on pprint This commit splits out a subset of GhcException which do not depend on pretty printing (SDoc), as a new datatype called PlainGhcException. These exceptions can be caught as GhcException, because 'fromException' will convert them. The motivation for this change is that that the Panic module transitively depends on many modules, primarily due to pretty printing code. It's on the order of about 130 modules. This large set of dependencies has a few implications: 1. To avoid cycles / use of boot files, these dependencies cannot throw GhcException. 2. There are some utility modules that use UnboxedTuples and also use `panic`. This means that when loading GHC into GHCi, about 130 additional modules would need to be compiled instead of interpreted. Splitting the non-pprint exception throwing into a new module resolves this issue. See #13101 --- compiler/utils/StringBuffer.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/utils/StringBuffer.hs') diff --git a/compiler/utils/StringBuffer.hs b/compiler/utils/StringBuffer.hs index 64578bffde..98b8c19340 100644 --- a/compiler/utils/StringBuffer.hs +++ b/compiler/utils/StringBuffer.hs @@ -50,7 +50,7 @@ import GhcPrelude import Encoding import FastString import FastFunctions -import Outputable +import PlainPanic import Util import Data.Maybe -- cgit v1.2.1