Skip to content

Commit

Permalink
Remove unused code and unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcoram committed Jul 10, 2024
1 parent a8108a5 commit eba9808
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 47 deletions.
3 changes: 1 addition & 2 deletions openvaf/hir/src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use hir_ty::db::HirTyDB;
use hir_ty::inference;
use hir_ty::types::{Signature, Ty};

pub use hir_def::expr::Event;
pub use hir_def::{expr::CaseCond, BuiltIn, Case, ExprId, Literal, ParamSysFun, StmtId, Type};
pub use hir_def::{expr::Event, BuiltIn, Case, ExprId, Literal, ParamSysFun, StmtId, Type};
pub use syntax::ast::{BinaryOp, UnaryOp};

use crate::{Branch, CompilationDB, Node};
Expand Down
10 changes: 0 additions & 10 deletions openvaf/mir/src/dominators.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ use bitset::SparseBitMatrix;
use stdx::packed_option::PackedOption;
use typed_index_collections::{TiSlice, TiVec};

trait CfgREVERSE {
type Successors;
type Predecessors;

fn successors(cfg: &ControlFlowGraph, bb: Block) -> Self::Successors;
fn predecessors(cfg: &ControlFlowGraph, bb: Block) -> Self::Successors;
}

trait ToIter {}

#[derive(Debug, Clone, PartialEq, Eq)]
struct DomTreeNode {
/// Number of this node in a (reverse) post-order traversal of the CFG, starting from 1.
Expand Down
15 changes: 0 additions & 15 deletions openvaf/mir/src/write.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,6 @@ impl<'a> fmt::Display for DisplayValues<'a> {
}
}

struct DisplayValuesWithDelimiter<'a>(&'a [Value], char);

impl<'a> fmt::Display for DisplayValuesWithDelimiter<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for (i, val) in self.0.iter().enumerate() {
if i == 0 {
write!(f, "{}", val)?;
} else {
write!(f, "{}{}", self.1, val)?;
}
}
Ok(())
}
}

/// A lasso resolver that always returns `"<DUMMY>"`.
/// Mainly useful for debugging
pub struct DummyResolver;
Expand Down
21 changes: 1 addition & 20 deletions openvaf/mir_opt/src/simplify_cfg.rs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::hash::{Hash, Hasher};
use std::iter::repeat;

use bitset::BitSet;
use mir::{Block, ControlFlowGraph, Function, InstructionData, Value, ValueDef, FALSE, TRUE};
use mir::{Block, ControlFlowGraph, Function, InstructionData, ValueDef, FALSE, TRUE};

#[cfg(test)]
mod tests;
Expand Down Expand Up @@ -634,21 +633,3 @@ impl<'a> SimplifyCfg<'a> {
}
}
}

#[derive(Clone)]
struct ResolvedPhi<I> {
vals: I,
}
impl<I: Iterator<Item = Value> + Clone> Hash for ResolvedPhi<I> {
fn hash<H: Hasher>(&self, state: &mut H) {
for val in self.vals.clone() {
val.hash(state)
}
}
}
impl<I: Iterator<Item = Value> + Clone> PartialEq for ResolvedPhi<I> {
fn eq(&self, other: &Self) -> bool {
self.vals.clone().eq(other.vals.clone())
}
}
impl<I: Iterator<Item = Value> + Clone> Eq for ResolvedPhi<I> {}

0 comments on commit eba9808

Please sign in to comment.