summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/DynFlags.hs17
-rw-r--r--compiler/main/DynFlags.hs-boot2
2 files changed, 17 insertions, 2 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 8bbf364ce8..b83248064b 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -95,12 +95,15 @@ module DynFlags (
getStgToDo,
-- * Compiler configuration suitable for display to the user
- compilerInfo
+ compilerInfo,
+
#ifdef GHCI
-- Only in stage 2 can we be sure that the RTS
-- exposes the appropriate runtime boolean
- , rtsIsProfiled
+ rtsIsProfiled,
#endif
+ -- ** Only for use in the tracing functions in Outputable
+ tracingDynFlags,
) where
#include "HsVersions.h"
@@ -969,6 +972,16 @@ defaultDynFlags mySettings =
llvmVersion = panic "defaultDynFlags: No llvmVersion"
}
+-- Do not use tracingDynFlags!
+-- tracingDynFlags is a hack, necessary because we need to be able to
+-- show SDocs when tracing, but we don't always have DynFlags available.
+-- Do not use it if you can help it. It will not reflect options set
+-- by the commandline flags, and all fields may be either wrong or
+-- undefined.
+tracingDynFlags :: DynFlags
+tracingDynFlags = defaultDynFlags tracingSettings
+ where tracingSettings = panic "Settings not defined in tracingDynFlags"
+
type FatalMessager = String -> IO ()
type LogAction = DynFlags -> Severity -> SrcSpan -> PprStyle -> MsgDoc -> IO ()
diff --git a/compiler/main/DynFlags.hs-boot b/compiler/main/DynFlags.hs-boot
index f7d17f496b..7530192e1a 100644
--- a/compiler/main/DynFlags.hs-boot
+++ b/compiler/main/DynFlags.hs-boot
@@ -2,3 +2,5 @@
module DynFlags where
data DynFlags
+tracingDynFlags :: DynFlags
+