提交 8738a087 编写于 作者: F Felix S. Klock II

Moved mir-borrowck pass down to where comments say it should be.

Added two fixmes: The `SimplifyBranches` pass cannot stay where it is,
and `BorrowckMir` should be a query, not a pass. But I am going to
leave those changes to a future PR.
上级 6d6280e0
......@@ -970,8 +970,12 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
// We compute "constant qualifications" between MIR_CONST and MIR_VALIDATED.
// What we need to run borrowck etc.
passes.push_pass(MIR_CONST, mir::transform::borrow_check::BorrowckMir);
passes.push_pass(MIR_VALIDATED, mir::transform::qualify_consts::QualifyAndPromoteConstants);
// FIXME: ariel points SimplifyBranches should run after
// mir-borrowck; otherwise code within `if false { ... }` would
// not be checked.
passes.push_pass(MIR_VALIDATED,
mir::transform::simplify_branches::SimplifyBranches::new("initial"));
passes.push_pass(MIR_VALIDATED, mir::transform::simplify::SimplifyCfg::new("qualify-consts"));
......@@ -979,6 +983,10 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
// borrowck runs between MIR_VALIDATED and MIR_OPTIMIZED.
// FIXME: niko says this should be a query (see rustc::ty::maps)
// instead of a pass.
passes.push_pass(MIR_VALIDATED, mir::transform::borrow_check::BorrowckMir);
// These next passes must be executed together
passes.push_pass(MIR_OPTIMIZED, mir::transform::no_landing_pads::NoLandingPads);
passes.push_pass(MIR_OPTIMIZED, mir::transform::add_call_guards::CriticalCallEdges);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册