[GHC] #8624: -ddump-splices-file

GHC ghc-devs at haskell.org
Mon May 19 04:05:03 UTC 2014


#8624: -ddump-splices-file
-------------------------------------+------------------------------------
        Reporter:  GregWeber         |            Owner:
            Type:  feature request   |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by GregWeber):

 After making the changes Nate suggested

 {{{
 diff --git a/compiler/typecheck/TcRnMonad.lhs
 b/compiler/typecheck/TcRnMonad.lhs
 index 17700e7..4c4be49 100644
 --- a/compiler/typecheck/TcRnMonad.lhs
 +++ b/compiler/typecheck/TcRnMonad.lhs
 @@ -502,7 +502,9 @@ traceOptTcRn flag doc = whenDOptM flag $ do
  dumpTcRn :: SDoc -> TcRn ()
  dumpTcRn doc = do { rdr_env <- getGlobalRdrEnv
                    ; dflags <- getDynFlags
 -                  ; liftIO (printInfoForUser dflags (mkPrintUnqualified
 dflags rdr_env) doc) }
 +                  ; liftIO $ do
 +                      dumpIfSet_dyn dflags Opt_D_dump_tc "Typechecker
 output" doc
 +                      (printInfoForUser dflags (mkPrintUnqualified dflags
 rdr_env) doc) }
 }}}

 running `ghc -ddump-tc -ddump-to-file Foo.hs` produces a file Foo.dump-tc:

 {{{
 ==================== Typechecker output ====================
 2014-05-19 03:56:39.777604 UTC

 TYPE SIGNATURES
 TYPE CONSTRUCTORS
   Foo.Foo :: *
   data Foo
     No C type associated
     RecFlag NonRecursive, Not promotable
     = Foo :: GHC.Types.Int -> Foo Stricts: _
     FamilyInstance: none
 COERCION AXIOMS
 Dependent modules: []
 Dependent packages: [base, ghc-prim, integer-gmp]


 ==================== Typechecker output ====================
 2014-05-19 03:56:39.78129 UTC


 ==================== Typechecker ====================

 }}}

 This only took me 10 minutes to make the code change, so that is an
 encouraging start. This is not what I want as an end result, but is this
 useful now for others that use -ddump-tc to debug? Should I add a new flag
 for my desired functionality?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8624#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list