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.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 687c6e1598..2f26276eb7 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -263,6 +263,7 @@ import GHC.Utils.Fingerprint
import GHC.Utils.Outputable
import GHC.Settings
import GHC.CmmToAsm.CFG.Weight
+import {-# SOURCE #-} GHC.Core.Opt.CallerCC
import GHC.Types.Error
import {-# SOURCE #-} GHC.Utils.Error
@@ -699,6 +700,7 @@ data DynFlags = DynFlags {
-- | what kind of {-# SCC #-} to add automatically
profAuto :: ProfAuto,
+ callerCcFilters :: [CallerCcFilter],
interactivePrint :: Maybe String,
@@ -1313,6 +1315,7 @@ defaultDynFlags mySettings llvmConfig =
canUseColor = False,
colScheme = Col.defaultScheme,
profAuto = NoProfAuto,
+ callerCcFilters = [],
interactivePrint = Nothing,
nextWrapperNum = panic "defaultDynFlags: No nextWrapperNum",
sseVersion = Nothing,
@@ -2947,6 +2950,10 @@ dynamic_flags_deps = [
, make_ord_flag defGhcFlag "fno-prof-auto"
(noArg (\d -> d { profAuto = NoProfAuto } ))
+ -- Caller-CC
+ , make_ord_flag defGhcFlag "fprof-callers"
+ (HasArg setCallerCcFilters)
+
------ Compiler flags -----------------------------------------------
, make_ord_flag defGhcFlag "fasm" (NoArg (setObjBackend NCG))
@@ -4548,6 +4555,12 @@ checkOptLevel n dflags
| otherwise
= Right dflags
+setCallerCcFilters :: String -> DynP ()
+setCallerCcFilters arg =
+ case parseCallerCcFilter arg of
+ Right filt -> upd $ \d -> d { callerCcFilters = filt : callerCcFilters d }
+ Left err -> addErr err
+
setMainIs :: String -> DynP ()
setMainIs arg
| not (null main_fn) && isLower (head main_fn)