Skip to content

Commit 3d19706

Browse files
committed
Verilog: cleanout unused Boolean operators from type checker
The Boolean ID_xor, ID_xnor, ID_nand, ID_nor are only ever generated as output by the Verilog type checker, and should never be inputs. This removes the case that handles them as inputs.
1 parent 75f52a8 commit 3d19706

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/verilog/verilog_typecheck_expr.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,9 +3508,7 @@ exprt verilog_typecheck_exprt::convert_binary_expr(binary_exprt expr)
35083508

35093509
return std::move(expr);
35103510
}
3511-
else if(
3512-
expr.id() == ID_and || expr.id() == ID_or || expr.id() == ID_xor ||
3513-
expr.id() == ID_xnor || expr.id() == ID_nand || expr.id() == ID_nor)
3511+
else if(expr.id() == ID_and || expr.id() == ID_or)
35143512
{
35153513
for(auto &op : expr.operands())
35163514
{
@@ -3524,6 +3522,13 @@ exprt verilog_typecheck_exprt::convert_binary_expr(binary_exprt expr)
35243522

35253523
return std::move(expr);
35263524
}
3525+
else if(
3526+
expr.id() == ID_xor || expr.id() == ID_xnor || expr.id() == ID_nand ||
3527+
expr.id() == ID_nor)
3528+
{
3529+
// should not occur -- only generated by the typechecker
3530+
PRECONDITION(false);
3531+
}
35273532
else if(expr.id() == ID_verilog_value_range)
35283533
{
35293534
for(auto &op : expr.operands())

0 commit comments

Comments
 (0)