Skip to content

Commit

Permalink
[ImportVerilog] Fix unknown name caused by local variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
hailongSun2000 committed May 7, 2024
1 parent 282bdb8 commit b1bc812
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Conversion/ImportVerilog/Statements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ struct StmtVisitor {
return failure();
}

builder.create<moore::VariableOp>(loc, type,
builder.getStringAttr(var.name), initial);
// Collect local temporary variables.
auto varOp = builder.create<moore::VariableOp>(
loc, type, builder.getStringAttr(var.name), initial);
context.valueSymbols.insertIntoScope(context.valueSymbols.getCurScope(),
&var, varOp);
return success();
}

Expand Down

0 comments on commit b1bc812

Please sign in to comment.