| 571 | } |
| 572 | |
| 573 | ExprPtr compileExpression( |
| 574 | const TypedExprPtr& expr, |
| 575 | Scope* scope, |
| 576 | const core::QueryConfig& config, |
| 577 | memory::MemoryPool* pool, |
| 578 | const std::unordered_set<std::string>& flatteningCandidates, |
| 579 | bool enableConstantFolding) { |
| 580 | auto rewritten = rewriteExpression(expr); |
| 581 | if (rewritten.get() != expr.get()) { |
| 582 | scope->rewrittenExpressions.push_back(rewritten); |
| 583 | } |
| 584 | return compileRewrittenExpression( |
| 585 | rewritten == nullptr ? expr : rewritten, |
| 586 | scope, |
| 587 | config, |
| 588 | pool, |
| 589 | flatteningCandidates, |
| 590 | enableConstantFolding); |
| 591 | } |
| 592 | |
| 593 | /// Walk expression tree and collect names of functions used in CallTypedExpr |
| 594 | /// into provided 'names' set. |