Skip to content

Commit

Permalink
Handle ITE Z3 expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
frabert committed Apr 29, 2024
1 parent 33dfc54 commit 5f2eed5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/AST/IRToASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ clang::Expr *IRToASTVisitor::ConvertExpr(z3::expr expr) {
CopyProvenance(sub, neg, dec_ctx.use_provenance);
return neg;
}
case Z3_OP_ITE: {
CHECK_EQ(expr.num_args(), 3)
<< "Conditional expressions must have three arguments";
auto cond{ConvertExpr(expr.arg(0))};
auto tt{ConvertExpr(expr.arg(1))};
auto ff{ConvertExpr(expr.arg(2))};
return ast.CreateConditional(cond, tt, ff);
}
default:
LOG(FATAL) << "Invalid z3 op " << expr.to_string();
}
Expand Down

0 comments on commit 5f2eed5

Please sign in to comment.