about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2018-12-08 08:43:45 +0100
committerGitHub <noreply@github.com>2018-12-08 08:43:45 +0100
commit253c448886da3eda55bef7bd68245f7d72c2e3b0 (patch)
tree946dd7816587461414d554e9d6ed4fecabeb990c
parentac15b4f4bd2b83b4fa2ed2c31b987d7c54268937 (diff)
parent5f9f05daeadbef38c76ed0ba2fbc53fb4fb63047 (diff)
Rollup merge of #56597 - vext01:dump-mir-usage, r=wesleywiser
Improve the usage message for `-Z dump-mir`.

Ouput now looks like this:
```
$ rustc -Z help
...
    -Z               arg-align-attributes -- emit align metadata for reference arguments
    -Z                       dump-mir=val -- dump MIR state to file.
        `val` is used to select which passes and functions to dump. For example:
        `all` matches all passes and functions,
        `foo` matches all passes for functions whose name contains 'foo',
        `foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
        `foo | bar` all passes for function names containing 'foo' or 'bar'.
    -Z                   dump-mir-dir=val -- the directory the MIR is dumped into
...
```

Fixes #56558
-rw-r--r--src/librustc/session/config.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 51855ff6cc8..750b7f151f5 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1272,7 +1272,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
     arg_align_attributes: bool = (false, parse_bool, [TRACKED],
         "emit align metadata for reference arguments"),
     dump_mir: Option<String> = (None, parse_opt_string, [UNTRACKED],
-        "dump MIR state at various points in transforms"),
+        "dump MIR state to file.
+        `val` is used to select which passes and functions to dump. For example:
+        `all` matches all passes and functions,
+        `foo` matches all passes for functions whose name contains 'foo',
+        `foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
+        `foo | bar` all passes for function names containing 'foo' or 'bar'."),
+
     dump_mir_dir: String = (String::from("mir_dump"), parse_string, [UNTRACKED],
         "the directory the MIR is dumped into"),
     dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],