From 46b342fbc03664566d65e1b3248f89cbef93ef4c Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 25 Apr 2017 18:23:33 -0400 Subject: simplify the MirPass traits and passes dramatically Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point). --- src/tools/compiletest/src/runtest.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/tools/compiletest') diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 731665ce034..a044282666d 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1402,18 +1402,16 @@ actual:\n\ } } MirOpt => { - args.extend(["-Z", - "dump-mir=all", - "-Z", - "mir-opt-level=3", - "-Z"] + args.extend(["-Zdump-mir=all", + "-Zmir-opt-level=3", + "-Zdump-mir-exclude-pass-number"] .iter() .map(|s| s.to_string())); let mir_dump_dir = self.get_mir_dump_dir(); create_dir_all(mir_dump_dir.as_path()).unwrap(); - let mut dir_opt = "dump-mir-dir=".to_string(); + let mut dir_opt = "-Zdump-mir-dir=".to_string(); dir_opt.push_str(mir_dump_dir.to_str().unwrap()); debug!("dir_opt: {:?}", dir_opt); -- cgit 1.4.1-3-g733a5