-- Is it worth evaluating this Bool and caching it in the DynFlags value
-- during initDynFlags?
doingTickyProfiling :: DynFlags -> Bool
-doingTickyProfiling dflags = WayTicky `elem` wayNames dflags
+doingTickyProfiling _ = opt_Ticky
+ -- XXX -ticky is a static flag, because it implies -debug which is also
+ -- static. If the way flags were made dynamic, we could fix this.
data PackageFlag
= ExposePackage String
-- the name of a shared library is libHSfoo-ghc<version>.so
-- we leave out the _dyn, because it is superfluous
- -- debug RTS includes support for -ticky and -eventlog
+ -- debug RTS includes support for -eventlog
ways2 | WayDebug `elem` map wayName ways1
- = filter ((`notElem` [WayTicky,WayEventLog]) . wayName) ways1
+ = filter ((/= WayEventLog) . wayName) ways1
| otherwise
= ways1
------- ways --------------------------------------------------------
, Flag "prof" (NoArg (addWay WayProf)) Supported
, Flag "eventlog" (NoArg (addWay WayEventLog)) Supported
- , Flag "ticky" (NoArg (addWay WayTicky)) Supported
, Flag "parallel" (NoArg (addWay WayPar)) Supported
, Flag "gransim" (NoArg (addWay WayGran)) Supported
, Flag "smp" (NoArg (addWay WayThreaded))
, Flag "debug" (NoArg (addWay WayDebug)) Supported
, Flag "ndp" (NoArg (addWay WayNDP)) Supported
, Flag "threaded" (NoArg (addWay WayThreaded)) Supported
- -- ToDo: user ways
+
+ , Flag "ticky" (PassFlag (\f -> do addOpt f; addWay WayDebug)) Supported
+ -- -ticky enables ticky-ticky code generation, and also implies -debug which
+ -- is required to get the RTS ticky support.
------ Debugging ----------------------------------------------------
, Flag "dppr-debug" (PassFlag addOpt) Supported
v_Ld_inputs,
tablesNextToCode,
opt_StubDeadValues,
+ opt_Ticky,
-- For the parser
addOpt, removeOpt, addWay, getWayFlags, v_opt_C_ready
opt_ErrorSpans :: Bool
opt_ErrorSpans = lookUp (fsLit "-ferror-spans")
+opt_Ticky :: Bool
+opt_Ticky = lookUp (fsLit "-ticky")
-- object files and libraries to be linked in are collected here.
-- ToDo: perhaps this could be done without a global, it wasn't obvious
-- non-profiling objects.
-- After parsing the command-line options, we determine which "way" we
--- are building - this might be a combination way, eg. profiling+ticky-ticky.
+-- are building - this might be a combination way, eg. profiling+threaded.
-- We then find the "build-tag" associated with this way, and this
-- becomes the suffix used to find .hi files and libraries used in
| WayDebug
| WayProf
| WayEventLog
- | WayTicky
| WayPar
| WayGran
| WayNDP
_ `allowedWith` WayDyn = True
WayDyn `allowedWith` _ = True
- -- ticky is (now) allowed with everything
- -- Indeed, ticky should no longer be a 'way' at all
- _ `allowedWith` WayTicky = True
- WayTicky `allowedWith` _ = True
-
-- debug is allowed with everything
_ `allowedWith` WayDebug = True
WayDebug `allowedWith` _ = True
[ "-DTRACING"
, "-optc-DTRACING" ],
- Way WayTicky "t" True "Ticky-ticky Profiling"
- [ "-DTICKY_TICKY"
- , "-optc-DTICKY_TICKY" ],
-
Way WayPar "mp" False "Parallel"
[ "-fparallel"
, "-D__PARALLEL_HASKELL__"
# debug_p : debugging profiled
# thr_debug : debugging threaded
# thr_debug_p : debugging threaded profiled
-# t : ticky-ticky profiling
-# debug_t : debugging ticky-ticky profiling
# l : event logging
# thr_l : threaded and event logging
#
WAY_p_NAME=profiling
WAY_p_HC_OPTS= -prof
-# Way 't':
-WAY_t_NAME=ticky-ticky profiling
-WAY_t_HC_OPTS= -ticky
-
# Way 'l':
WAY_l_NAME=event logging
WAY_l_HC_OPTS= -eventlog
WAY_debug_p_NAME=debug profiled
WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
-# Way 'debug_t':
-WAY_debug_t_NAME=debug ticky-ticky profiling
-WAY_debug_t_HC_OPTS= -ticky -optc-DDEBUG
-
# Way 'thr_debug':
WAY_thr_debug_NAME=threaded
WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG