| 628 | } |
| 629 | |
| 630 | void PostVisitExpr(const cel::Expr& expr) override { |
| 631 | if (!progress_status_.ok()) { |
| 632 | return; |
| 633 | } |
| 634 | if (&expr == resume_from_suppressed_branch_) { |
| 635 | resume_from_suppressed_branch_ = nullptr; |
| 636 | } |
| 637 | |
| 638 | for (const std::unique_ptr<ProgramOptimizer>& optimizer : |
| 639 | program_optimizers_) { |
| 640 | absl::Status status = optimizer->OnPostVisit(extension_context_, expr); |
| 641 | if (!status.ok()) { |
| 642 | SetProgressStatusError(status); |
| 643 | return; |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | auto* subexpression = program_builder_.current(); |
| 648 | if (subexpression != nullptr && options_.enable_recursive_tracing && |
| 649 | subexpression->IsRecursive()) { |
| 650 | auto program = subexpression->ExtractRecursiveProgram(); |
| 651 | subexpression->set_recursive_program( |
| 652 | std::make_unique<TraceStep>(std::move(program.step)), program.depth); |
| 653 | } |
| 654 | |
| 655 | program_builder_.ExitSubexpression(&expr); |
| 656 | |
| 657 | if (!comprehension_stack_.empty() && |
| 658 | comprehension_stack_.back().is_optimizable_bind && |
| 659 | (&comprehension_stack_.back().comprehension->accu_init() == &expr)) { |
| 660 | SetProgressStatusError( |
| 661 | MaybeExtractSubexpression(&expr, comprehension_stack_.back())); |
| 662 | } |
| 663 | |
| 664 | if (block_.has_value()) { |
| 665 | BlockInfo& block = *block_; |
| 666 | if (block.current_binding == &expr) { |
| 667 | int index = program_builder_.ExtractSubexpression(&expr); |
| 668 | if (index == -1) { |
| 669 | SetProgressStatusError( |
| 670 | absl::InvalidArgumentError("failed to extract subexpression")); |
| 671 | return; |
| 672 | } |
| 673 | block.subexpressions[block.current_index++] = index; |
| 674 | block.current_binding = nullptr; |
| 675 | } |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | void PostVisitConst(const cel::Expr& expr, |
| 680 | const cel::Constant& const_expr) override { |
nothing calls this directly
no test coverage detected