From fb57f87ad779852b3bbcd96617fb211a8821d857 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 7 May 2007 10:24:18 +0000 Subject: [PATCH] FIX #1155: ghci -debug generates slightly odd message --- compiler/main/Main.hs | 8 ++++++-- compiler/main/StaticFlags.hs | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/main/Main.hs b/compiler/main/Main.hs index 048eee8..d5e8de7 100644 --- a/compiler/main/Main.hs +++ b/compiler/main/Main.hs @@ -223,11 +223,15 @@ checkOptions cli_mode dflags srcs objs = do let unknown_opts = [ f | (f@('-':_), _) <- srcs ] when (notNull unknown_opts) (unknownFlagsErr unknown_opts) + when (notNull (filter isRTSWay (wayNames dflags)) + && isInterpretiveMode cli_mode) $ + putStrLn ("Warning: -debug, -threaded and -ticky are ignored by GHCi") + -- -prof and --interactive are not a good combination - when (notNull (filter (/= WayThreaded) (wayNames dflags)) + when (notNull (filter (not . isRTSWay) (wayNames dflags)) && isInterpretiveMode cli_mode) $ do throwDyn (UsageError - "--interactive can't be used with -prof, -ticky, or -unreg.") + "--interactive can't be used with -prof or -unreg.") -- -ohi sanity check if (isJust (outputHi dflags) && (isCompManagerMode cli_mode || srcs `lengthExceeds` 1)) diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 2a8c4dc..1fa8388 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -14,7 +14,7 @@ module StaticFlags ( staticFlags, -- Ways - WayName(..), v_Ways, v_Build_tag, v_RTS_Build_tag, + WayName(..), v_Ways, v_Build_tag, v_RTS_Build_tag, isRTSWay, -- Output style options opt_PprUserLength, @@ -512,6 +512,8 @@ lkupWay w = Nothing -> error "findBuildTag" Just details -> details +isRTSWay = wayRTSOnly . lkupWay + data Way = Way { wayTag :: String, wayRTSOnly :: Bool, -- 1.7.10.4