Improve dumping for rules, and documentation of same
authorsimonpj@microsoft.com <unknown>
Tue, 8 Dec 2009 10:55:56 +0000 (10:55 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 8 Dec 2009 10:55:56 +0000 (10:55 +0000)
Inspired by Trac #3703

compiler/simplCore/SimplCore.lhs
docs/users_guide/debugging.xml
docs/users_guide/glasgow_exts.xml

index f26575b..9f656fb 100644 (file)
@@ -323,9 +323,9 @@ prepareRules hsc_env@(HscEnv { hsc_dflags = dflags, hsc_HPT = hpt })
 
        ; Err.dumpIfSet_dyn dflags Opt_D_dump_rules "Transformation rules"
                (withPprStyle (mkUserStyle (mkPrintUnqualified dflags rdr_env) AllTheWay) $
-                vcat [text "Local rules", pprRules simpl_rules,
+                vcat [text "Local rules for local Ids", pprRules simpl_rules,
                       blankLine,
-                      text "Imported rules", pprRuleBase hpt_rule_base])
+                      text "Local rules for imported Ids", pprRuleBase hpt_rule_base])
 
        ; return (hpt_rule_base, guts { mg_binds = binds_w_rules, 
                                        mg_rules = rules_for_imps })
index d1e9e16..513b26f 100644 (file)
                 <indexterm><primary><option>-ddump-rules</option></primary></indexterm>
              </term>
              <listitem>
-               <para>dumps all rewrite rules (including those generated
-             by the specialisation pass)</para>
+               <para>dumps all rewrite rules specified in this module; 
+                      see <xref linkend="controlling-rules"/>.
+                </para>
              </listitem>
            </varlistentry>
 
index 7e88a4f..603c6c6 100644 (file)
@@ -8605,8 +8605,8 @@ comparison.
 
 </sect2>
 
-<sect2>
-<title>Controlling what's going on</title>
+<sect2 id="controlling-rules">
+<title>Controlling what's going on in rewrite rules</title>
 
 <para>
 
@@ -8614,7 +8614,10 @@ comparison.
 <listitem>
 
 <para>
- Use <option>-ddump-rules</option> to see what transformation rules GHC is using.
+Use <option>-ddump-rules</option> to see the rules that are defined
+<emphasis>in this module</emphasis>.
+This includes rules generated by the specialisation pass, but excludes
+rules imported from other modules. 
 </para>
 </listitem>