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 1d2cd7c commit 7b48914
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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 @@ -141,7 +141,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) || rhs != use) {
if (rhs != use) {
Stmt newStmt = stmt.withNewUse(use, rhs);
if (newStmt != stmt) {
graph.replaceNode(stmt, newStmt);
Expand Down

0 comments on commit 7b48914

Please sign in to comment.