streamlining of expressions only used for script optimization

This commit is contained in:
Vern Paxson 2024-04-08 18:23:00 -04:00 committed by Tim Wojtulewicz
parent f557b40d14
commit 16b2946fef
2 changed files with 3 additions and 17 deletions

View file

@ -2083,7 +2083,8 @@ bool RecordCoerceExpr::WillTransform(Reducer* c) const { return op->Tag() == EXP
ExprPtr RecordCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt) {
if ( WillTransform(c) ) {
auto rt = cast_intrusive<RecordType>(type);
auto rc_op = op->AsRecordConstructorExpr();
ASSERT(op->Tag() == EXPR_RECORD_CONSTRUCTOR);
auto rc_op = static_cast<const RecordConstructorExpr*>(op.get());
auto known_constr = with_location_of(make_intrusive<RecordConstructorExpr>(rt, rc_op->Op()), this);
auto red_e = known_constr->Reduce(c, red_stmt);
return TransformMe(std::move(red_e), c, red_stmt);