Refactor unwind from Option to a new enum
This commit is contained in:
parent
7f6edd3f15
commit
daeb844e0c
39 changed files with 328 additions and 250 deletions
|
@ -3,7 +3,7 @@ use rustc_data_structures::graph::iterate::{
|
|||
NodeStatus, TriColorDepthFirstSearch, TriColorVisitor,
|
||||
};
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_middle::mir::{BasicBlock, BasicBlocks, Body, Operand, TerminatorKind};
|
||||
use rustc_middle::mir::{self, BasicBlock, BasicBlocks, Body, Operand, TerminatorKind};
|
||||
use rustc_middle::ty::subst::{GenericArg, InternalSubsts};
|
||||
use rustc_middle::ty::{self, Instance, TyCtxt};
|
||||
use rustc_session::lint::builtin::UNCONDITIONAL_RECURSION;
|
||||
|
@ -149,7 +149,9 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> {
|
|||
|
||||
fn ignore_edge(&mut self, bb: BasicBlock, target: BasicBlock) -> bool {
|
||||
let terminator = self.body[bb].terminator();
|
||||
if terminator.unwind() == Some(&Some(target)) && terminator.successors().count() > 1 {
|
||||
if terminator.unwind() == Some(&mir::UnwindAction::Cleanup(target))
|
||||
&& terminator.successors().count() > 1
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Don't traverse successors of recursive calls or false CFG edges.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue