From f3795c06370ed317957028027e4d18682bfeb447 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 4 Nov 2009 14:55:07 +0000 Subject: [PATCH] Finish #3439: -ticky implies -debug at link time; the ticky "way" has gone To get ticky profiling you still have to compile with -ticky (for those modules that you want to profile), but you can link with either -debug or -ticky. --- compiler/main/DynFlags.hs | 4 +++- compiler/main/Packages.lhs | 4 ++-- compiler/main/StaticFlagParser.hs | 6 ++++-- compiler/main/StaticFlags.hs | 15 ++++----------- mk/config.mk.in | 2 -- mk/ways.mk | 8 -------- 6 files changed, 13 insertions(+), 26 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index cd0f212..ab9d821 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -546,7 +546,9 @@ isNoLink _ = False -- 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 diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 4c22b34..e9108e7 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -808,9 +808,9 @@ packageHsLibs dflags p = map (mkDynName . addSuffix) (hsLibraries p) -- the name of a shared library is libHSfoo-ghc.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 diff --git a/compiler/main/StaticFlagParser.hs b/compiler/main/StaticFlagParser.hs index 966b6ec..b0b3761 100644 --- a/compiler/main/StaticFlagParser.hs +++ b/compiler/main/StaticFlagParser.hs @@ -107,7 +107,6 @@ static_flags = [ ------- 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)) @@ -115,7 +114,10 @@ static_flags = [ , 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 diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index f310fa0..9553081 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -73,6 +73,7 @@ module StaticFlags ( v_Ld_inputs, tablesNextToCode, opt_StubDeadValues, + opt_Ticky, -- For the parser addOpt, removeOpt, addWay, getWayFlags, v_opt_C_ready @@ -290,6 +291,8 @@ tablesNextToCode = not opt_Unregisterised 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 @@ -306,7 +309,7 @@ GLOBAL_VAR(v_Ld_inputs, [], [String]) -- 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 @@ -317,7 +320,6 @@ data WayName | WayDebug | WayProf | WayEventLog - | WayTicky | WayPar | WayGran | WayNDP @@ -338,11 +340,6 @@ allowed_combination way = and [ x `allowedWith` y _ `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 @@ -419,10 +416,6 @@ way_details = [ "-DTRACING" , "-optc-DTRACING" ], - Way WayTicky "t" True "Ticky-ticky Profiling" - [ "-DTICKY_TICKY" - , "-optc-DTICKY_TICKY" ], - Way WayPar "mp" False "Parallel" [ "-fparallel" , "-D__PARALLEL_HASKELL__" diff --git a/mk/config.mk.in b/mk/config.mk.in index 7acb3a2..fff9e5a 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -235,8 +235,6 @@ BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO)) # 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 # diff --git a/mk/ways.mk b/mk/ways.mk index deba1d5..c2dcf07 100644 --- a/mk/ways.mk +++ b/mk/ways.mk @@ -40,10 +40,6 @@ WAY_v_HC_OPTS= 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 @@ -80,10 +76,6 @@ WAY_debug_HC_OPTS=-optc-DDEBUG 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 -- 1.7.10.4