summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Session.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r--compiler/GHC/Driver/Session.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 9640c13a66..dd5aeb8b7e 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -40,6 +40,7 @@ module GHC.Driver.Session (
lang_set,
DynamicTooState(..), dynamicTooState, setDynamicNow,
sccProfilingEnabled,
+ needSourceNotes,
DynFlags(..),
outputFile, objectSuf, ways,
FlagSpec(..),
@@ -4828,6 +4829,11 @@ isBmi2Enabled dflags = case platformArch (targetPlatform dflags) of
sccProfilingEnabled :: DynFlags -> Bool
sccProfilingEnabled dflags = profileIsProfiling (targetProfile dflags)
+-- | Indicate whether we need to generate source notes
+needSourceNotes :: DynFlags -> Bool
+needSourceNotes dflags = debugLevel dflags > 0
+ || gopt Opt_InfoTableMap dflags
+
-- -----------------------------------------------------------------------------
-- Linker/compiler information