Use the EntryOrExit variants qualified.

This commit is contained in:
Ms2ger 2015-11-24 13:06:12 +01:00
parent 561d0884e5
commit 0eebc0cc04
2 changed files with 5 additions and 8 deletions

View File

@ -14,8 +14,6 @@
//! and thus uses bitvectors. Your job is simply to specify the so-called
//! GEN and KILL bits for each expression.
pub use self::EntryOrExit::*;
use middle::cfg;
use middle::cfg::CFGIndex;
use middle::ty;
@ -340,7 +338,7 @@ pub fn each_bit_on_entry<F>(&self, id: ast::NodeId, mut f: F) -> bool where
}
let indices = get_cfg_indices(id, &self.nodeid_to_index);
for &cfgidx in indices {
if !self.each_bit_for_node(Entry, cfgidx, |i| f(i)) {
if !self.each_bit_for_node(EntryOrExit::Entry, cfgidx, |i| f(i)) {
return false;
}
}
@ -363,8 +361,8 @@ pub fn each_bit_for_node<F>(&self, e: EntryOrExit, cfgidx: CFGIndex, f: F) -> bo
let on_entry = &self.on_entry[start.. end];
let temp_bits;
let slice = match e {
Entry => on_entry,
Exit => {
EntryOrExit::Entry => on_entry,
EntryOrExit::Exit => {
let mut t = on_entry.to_vec();
self.apply_gen_kill(cfgidx, &mut t);
temp_bits = t;

View File

@ -22,7 +22,6 @@
use dot;
use rustc::middle::cfg::CFGIndex;
use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
use rustc::middle::dataflow;
use std::rc::Rc;
use std::borrow::IntoCow;
@ -134,8 +133,8 @@ impl<'a, 'tcx> dot::Labeller<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 't
fn graph_id(&'a self) -> dot::Id<'a> { self.inner.graph_id() }
fn node_id(&'a self, n: &Node<'a>) -> dot::Id<'a> { self.inner.node_id(n) }
fn node_label(&'a self, n: &Node<'a>) -> dot::LabelText<'a> {
let prefix = self.dataflow_for(dataflow::Entry, n);
let suffix = self.dataflow_for(dataflow::Exit, n);
let prefix = self.dataflow_for(EntryOrExit::Entry, n);
let suffix = self.dataflow_for(EntryOrExit::Exit, n);
let inner_label = self.inner.node_label(n);
inner_label
.prefix_line(dot::LabelText::LabelStr(prefix.into_cow()))