Skip to content

Commit

Permalink
Dead code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed May 1, 2024
1 parent 6366dcf commit 19913ba
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 414 deletions.
30 changes: 3 additions & 27 deletions crates/paralegal-flow/src/ana/graph_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,28 +464,14 @@ impl<'a, 'tcx, C: Extend<DefId>> GraphConverter<'tcx, 'a, C> {
let body = &tcx.body_for_def_id(at.function).unwrap().body;

let node_span = body.local_decls[weight.place.local].source_info.span;
let new_idx = self.register_node(
self.register_node(
i,
NodeInfo {
at: weight.at,
description: format!("{:?}", weight.place),
span: src_loc_for_span(node_span, tcx),
},
);
trace!(
"Node {new_idx:?}\n description: {:?}\n at: {at}\n stmt: {}",
weight.place,
match at.location {
RichLocation::Location(loc) => {
match body.stmt_at(loc) {
Either::Left(s) => format!("{:?}", s.kind),
Either::Right(s) => format!("{:?}", s.kind),
}
}
RichLocation::End => "end".to_string(),
RichLocation::Start => "start".to_string(),
}
);
self.node_annotations(i, weight);

self.handle_node_types(i, weight);
Expand Down Expand Up @@ -526,11 +512,6 @@ impl<'a, 'tcx, C: Extend<DefId>> GraphConverter<'tcx, 'a, C> {
Either::Right(self.marker_ctx().shallow_type_markers(typ.ty))
}
.map(|(d, _)| d)

// self.marker_ctx()
// .all_type_markers(typ.ty)
// .map(|t| t.1 .1)
// .collect()
}

/// Similar to `CallString::is_at_root`, but takes into account top-level
Expand All @@ -551,20 +532,15 @@ impl<'a, 'tcx, C: Extend<DefId>> GraphConverter<'tcx, 'a, C> {
/// TODO: Include mutable inputs
fn determine_return(&self) -> Box<[Node]> {
// In async functions
let return_candidates = self
.spdg
self.spdg
.node_references()
.filter(|n| {
let weight = n.weight();
let at = weight.at;
matches!(self.try_as_root(at), Some(l) if l.location == RichLocation::End)
})
.map(|n| n.id())
.collect::<Box<[_]>>();
if return_candidates.len() != 1 {
warn!("Found many candidates for the return: {return_candidates:?}.");
}
return_candidates
.collect()
}

/// Determine the set if nodes corresponding to the inputs to the
Expand Down
1 change: 0 additions & 1 deletion crates/paralegal-flow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub mod dbg;
mod discover;
mod stats;
//mod sah;
pub mod serializers;
#[macro_use]
pub mod utils;
pub mod consts;
Expand Down
163 changes: 0 additions & 163 deletions crates/paralegal-flow/src/serializers.rs

This file was deleted.

Loading

0 comments on commit 19913ba

Please sign in to comment.