Create empty dump files when there was nothing to dump
authorVladimir Trubilov <vtrubiloff@gmail.com>
Wed, 2 Dec 2015 19:47:23 +0000 (20:47 +0100)
committerBen Gamari <ben@smart-cactus.org>
Wed, 2 Dec 2015 20:56:11 +0000 (21:56 +0100)
commit8cba907ad404ba4005558b5a8966390159938172
tree585bc4a085133b3f0f3fa8609cc88ee25c6e7339
parenta12e47bed74e305b37e68014c52feba3dd075514
Create empty dump files when there was nothing to dump

This patch creates empty dump file when GHC was run with
`-ddump-rule-firings` (or `-ddump-rule-rewrites`) and `-ddump-to-file`
specified, and there were no rules applied. If dump already exists it
will be overwritten by empty one.

Test Plan: ./validate

Reviewers: austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

Projects: #ghc

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

GHC Trac Issues: #10320
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
testsuite/tests/driver/Makefile
testsuite/tests/driver/T10320-with-rule.hs [new file with mode: 0644]
testsuite/tests/driver/T10320-without-rules.hs [new file with mode: 0644]
testsuite/tests/driver/all.T