From 751203ddcf825e8e5e1b0d4601b1e0e8cbd05a82 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 29 Jul 2010 20:15:03 +0000 Subject: [PATCH] Add a debugTrace for the phases that we run --- compiler/main/DriverPhases.hs | 5 ++++- compiler/main/DriverPipeline.hs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs index 1532c2f..eb217ab 100644 --- a/compiler/main/DriverPhases.hs +++ b/compiler/main/DriverPhases.hs @@ -35,7 +35,7 @@ module DriverPhases ( #include "HsVersions.h" -import Panic ( panic ) +import Outputable import System.FilePath ----------------------------------------------------------------------------- @@ -91,6 +91,9 @@ data Phase | StopLn -- Stop, but linking will follow, so generate .o file deriving (Eq, Show) +instance Outputable Phase where + ppr p = text (show p) + anyHsc :: Phase anyHsc = Hsc (panic "anyHsc") diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 687c435..81886ec 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -581,7 +581,9 @@ pipeLoop hsc_env phase stop_phase " but I wanted to stop at phase " ++ show stop_phase) | otherwise - = do (next_phase, dflags', maybe_loc, output_fn) + = do liftIO $ debugTraceMsg (hsc_dflags hsc_env) 4 + (ptext (sLit "Running phase") <+> ppr phase) + (next_phase, dflags', maybe_loc, output_fn) <- runPhase phase stop_phase hsc_env orig_basename orig_suff input_fn orig_get_output_fn maybe_loc let hsc_env' = hsc_env {hsc_dflags = dflags'} -- 1.7.10.4