Skip to content

Commit

Permalink
Reformatted as that's now in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkysen committed Aug 10, 2022
1 parent 49e006d commit 14d2398
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pdg/src/info.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::graph::{Graph, GraphId, Graphs, Node, NodeId, NodeKind};
use itertools::Itertools;
use rustc_index::vec::IndexVec;
use rustc_middle::mir::Field;
use std::collections::HashMap;
use std::collections::HashSet;
use itertools::Itertools;
use std::fmt::{self, Debug, Display, Formatter};

/// The information checked in this struct is whether nodes flow to loads, stores, and offsets (pos
Expand All @@ -29,10 +29,11 @@ impl Display for NodeInfo {
("+offset", self.flows_to_neg_offset),
("-offset", self.flows_to_neg_offset),
("non unique by", self.non_unique),
].into_iter()
.filter_map(|(name,node)| Some((name,node?)))
]
.into_iter()
.filter_map(|(name, node)| Some((name, node?)))
.format_with(", ", |(name, node), f| f(&format_args!("{name} {node}")));
write!(f,"{}", s)
write!(f, "{}", s)
}
}

Expand All @@ -53,11 +54,12 @@ fn node_does_neg_offset(n: &Node) -> bool {
}

fn add_children_to_vec(g: &Graph, parents: &HashSet<NodeId>, v: &mut Vec<NodeId>) {
v.extend(g.nodes
.iter_enumerated()
.filter_map(|(id,node)| Some((id,node.source?)))
.filter(|(_,src_idx)| parents.contains(src_idx))
.map(|(id,_)| id)
v.extend(
g.nodes
.iter_enumerated()
.filter_map(|(id, node)| Some((id, node.source?)))
.filter(|(_, src_idx)| parents.contains(src_idx))
.map(|(id, _)| id),
);
}

Expand Down Expand Up @@ -155,9 +157,9 @@ pub fn check_whether_rules_obeyed(g: &Graph, n: &NodeId) -> Option<NodeId> {
to_view.extend(
g.nodes
.iter_enumerated()
.filter_map(|(id,node)| Some((id,node.source?)))
.filter(|(_,src_idx)| *src_idx == cur_node_id)
.map(|(id,_)| (id,lineage.clone()))
.filter_map(|(id, node)| Some((id, node.source?)))
.filter(|(_, src_idx)| *src_idx == cur_node_id)
.map(|(id, _)| (id, lineage.clone())),
);
}
None
Expand Down

0 comments on commit 14d2398

Please sign in to comment.