add -th-file which generates a th.hs file
authorGreg Weber <greg@gregweber.info>
Mon, 12 Jan 2015 11:16:37 +0000 (05:16 -0600)
committerAustin Seipp <austin@well-typed.com>
Tue, 13 Jan 2015 16:10:38 +0000 (10:10 -0600)
commit07ace5c221adbb1675413a0fac300a9f7913c234
treed00e7a658680ce0e2488f40ccbb4297708af1820
parent0fa4240249058f327cfd283f9da2deb8dff664f1
add -th-file which generates a th.hs file

Summary:
see Trac #8624

similar functionality is now available
with -ddump-to-file -ddump-splices

However, users are already accustomed to -ddump-splices
having a particular format, and this format is not completely valid code
The goal of -th-file is to dump valid Haskell code

Additionally, the convention of -ddump-to-file is to name the file after
the flag, so the file is .dump-splices
Given that the goal of the new flag is to generate valid Haskell,
The extension should be .hs

Additionally, -ddump-to-file effects all other dump flags

Test Plan:
look at the output of using the -th-file flag
and compare it to the output of using -ddump-to-file and -ddump-splices
I want to add test cases, but just need some pointers on getting started there

Reviewers: thomie, goldfire, simonpj, austin

Reviewed By: simonpj, austin

Subscribers: thomie, carter

Differential Revision: https://phabricator.haskell.org/D518

GHC Trac Issues: #8624
30 files changed:
.gitignore
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
compiler/rename/RnSplice.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcSplice.hs-boot
docs/users_guide/7.12.1-notes.xml
docs/users_guide/flags.xml
docs/users_guide/glasgow_exts.xml
testsuite/tests/indexed-types/should_fail/T8129.stdout
testsuite/tests/th/Makefile
testsuite/tests/th/T3319.stderr
testsuite/tests/th/T3600.stderr
testsuite/tests/th/T5217.stderr
testsuite/tests/th/T5290.stderr
testsuite/tests/th/T5700.stderr
testsuite/tests/th/T5883.stderr
testsuite/tests/th/T5984.stderr
testsuite/tests/th/T7532.stderr
testsuite/tests/th/T8624.hs [new file with mode: 0644]
testsuite/tests/th/T8624.stderr [new file with mode: 0644]
testsuite/tests/th/T8624.stdout [new file with mode: 0644]
testsuite/tests/th/TH_TyInstWhere1.stderr
testsuite/tests/th/TH_foreignCallingConventions.stderr
testsuite/tests/th/TH_foreignInterruptible.stderr
testsuite/tests/th/TH_genEx.stderr
testsuite/tests/th/TH_pragma.stderr
testsuite/tests/th/all.T