MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / EnableConstantFoldingImpl

Function EnableConstantFoldingImpl

runtime/constant_folding.cc:55–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55absl::Status EnableConstantFoldingImpl(
56 RuntimeBuilder& builder, absl_nullable std::shared_ptr<google::protobuf::Arena> arena,
57 absl_nullable std::shared_ptr<google::protobuf::MessageFactory> message_factory) {
58 CEL_ASSIGN_OR_RETURN(RuntimeImpl* absl_nonnull runtime_impl,
59 RuntimeImplFromBuilder(builder));
60 if (arena != nullptr) {
61 runtime_impl->environment().KeepAlive(arena);
62 }
63 if (message_factory != nullptr) {
64 runtime_impl->environment().KeepAlive(message_factory);
65 }
66 runtime_impl->expr_builder().AddProgramOptimizer(
67 runtime_internal::CreateConstantFoldingOptimizer(
68 std::move(arena), std::move(message_factory)));
69 return absl::OkStatus();
70}
71
72} // namespace
73

Callers 1

EnableConstantFoldingFunction · 0.85

Calls 5

KeepAliveMethod · 0.80
AddProgramOptimizerMethod · 0.80
RuntimeImplFromBuilderFunction · 0.70
CEL_ASSIGN_OR_RETURNFunction · 0.50

Tested by

no test coverage detected