diff options
author | Kai Harries <kai.harries@gmail.com> | 2016-03-23 16:21:52 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-03-24 10:53:27 +0100 |
commit | 9f9345e5ad55e4a02e6de9afac814ac58c852ff2 (patch) | |
tree | 420686d08fa4f4be46ea5bb4439142707079d001 /compiler/simplCore | |
parent | 6c2c853b11fe25c106469da7b105e2be596c17de (diff) | |
download | haskell-9f9345e5ad55e4a02e6de9afac814ac58c852ff2.tar.gz |
Create empty dump files (fixes #10320)
Test Plan: ./validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2015
GHC Trac Issues: #10320
Diffstat (limited to 'compiler/simplCore')
-rw-r--r-- | compiler/simplCore/Simplify.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index e9053002d6..debc7d8fda 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -1581,7 +1581,9 @@ tryRules env rules fn args call_cont = do { dflags <- getDynFlags ; case lookupRule dflags (getUnfoldingInRuleMatch env) (activeRule env) fn (argInfoAppArgs args) rules of { - Nothing -> return Nothing ; -- No rule matches + Nothing -> + do { nodump dflags -- This ensures that an empty file is written + ; return Nothing } ; -- No rule matches Just (rule, rule_rhs) -> do { checkedTick (RuleFired (ru_name rule)) ; let cont' = pushSimplifiedArgs env @@ -1606,6 +1608,16 @@ tryRules env rules fn args call_cont | otherwise = return () + nodump dflags + | dopt Opt_D_dump_rule_rewrites dflags + = liftIO $ dumpSDoc dflags alwaysQualify Opt_D_dump_rule_rewrites "" empty + + | dopt Opt_D_dump_rule_firings dflags + = liftIO $ dumpSDoc dflags alwaysQualify Opt_D_dump_rule_firings "" empty + + | otherwise + = return () + log_rule dflags flag hdr details = liftIO . dumpSDoc dflags alwaysQualify flag "" $ sep [text hdr, nest 4 details] |