mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-11 07:21:51 +00:00
Emit EndRegion
statements when given -Z mir-emit-validate=N
(for N > 0).
This way the miri test suite does not have to be updated to explcitly request `-Z emit-end-regions`.
This commit is contained in:
parent
c11f3e36c8
commit
f2892ad281
@ -410,6 +410,10 @@ impl Session {
|
||||
pub fn print_llvm_passes(&self) -> bool {
|
||||
self.opts.debugging_opts.print_llvm_passes
|
||||
}
|
||||
pub fn emit_end_regions(&self) -> bool {
|
||||
self.opts.debugging_opts.emit_end_regions ||
|
||||
(self.opts.debugging_opts.mir_emit_validate > 0)
|
||||
}
|
||||
pub fn lto(&self) -> bool {
|
||||
self.opts.cg.lto
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ impl<'tcx> CFG<'tcx> {
|
||||
block: BasicBlock,
|
||||
source_info: SourceInfo,
|
||||
region_scope: region::Scope) {
|
||||
if tcx.sess.opts.debugging_opts.emit_end_regions {
|
||||
if tcx.sess.emit_end_regions() {
|
||||
self.push(block, Statement {
|
||||
source_info,
|
||||
kind: StatementKind::EndRegion(region_scope),
|
||||
|
@ -42,7 +42,7 @@ impl MirPass for CleanEndRegions {
|
||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
_source: MirSource,
|
||||
mir: &mut Mir<'tcx>) {
|
||||
if !tcx.sess.opts.debugging_opts.emit_end_regions { return; }
|
||||
if !tcx.sess.emit_end_regions() { return; }
|
||||
|
||||
let mut gather = GatherBorrowedRegions {
|
||||
seen_regions: FxHashSet()
|
||||
|
Loading…
Reference in New Issue
Block a user