"the directory the MIR is dumped into"),
dump_mir_exclude_pass_number: bool = (false, parse_bool, [UNTRACKED],
"if set, exclude the pass number when dumping MIR (used in tests)"),
+ mir_emit_validate: bool = (false, parse_bool, [TRACKED],
+ "emit Validate MIR statements, interpreted e.g. by miri"),
perf_stats: bool = (false, parse_bool, [UNTRACKED],
"print some performance-related statistics"),
hir_stats: bool = (false, parse_bool, [UNTRACKED],
tcx: TyCtxt<'a, 'tcx, 'tcx>,
_: MirSource,
mir: &mut Mir<'tcx>) {
+ if !tcx.sess.opts.debugging_opts.mir_emit_validate {
+ return;
+ }
+
let local_decls = mir.local_decls.clone(); // TODO: Find a way to get rid of this clone.
/// Convert an lvalue to a validation operand.
block: BasicBlock,
statement: &mut Statement<'tcx>,
location: Location) {
+ if !self.tcx.sess.opts.debugging_opts.mir_emit_validate {
+ if let StatementKind::EndRegion(_) = statement.kind {
+ statement.kind = StatementKind::Nop;
+ }
+ }
+
self.in_validation_statement = match statement.kind {
StatementKind::Validate(..) => true,
_ => false,