Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilagichani14 committed Aug 16, 2024
1 parent 26e0e7b commit dea9d98
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) {
Local m = (Local) rhs;
if (use != m) {
Integer defCount = m.getDefs(stmtGraph.getStmts()).size();
if (defCount == null || defCount == 0) {
if (defCount == 0) {
throw new RuntimeException("Variable " + m + " used without definition!");
} else if (defCount == 1) {
newStmt = replaceUse(stmtGraph, newStmt, use, rhs);
Expand Down Expand Up @@ -142,7 +142,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) {

private Stmt replaceUse(
@Nonnull MutableStmtGraph graph, @Nonnull Stmt stmt, @Nonnull Value use, @Nonnull Value rhs) {
if (!use.equivTo(rhs)) { // TODO: ms: check if rhs!=use would be enough
if (rhs != use) {
Stmt newStmt = stmt.withNewUse(use, rhs);
if (newStmt != stmt) {
graph.replaceNode(stmt, newStmt);
Expand Down

0 comments on commit dea9d98

Please sign in to comment.