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

Function StandardRuntimeOrDie

eval/tests/modern_benchmark_test.cc:93–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91enum class ConstFoldingEnabled { kNo, kYes };
92
93std::unique_ptr<const cel::Runtime> StandardRuntimeOrDie(
94 const cel::RuntimeOptions& options, google::protobuf::Arena* arena = nullptr,
95 ConstFoldingEnabled const_folding = ConstFoldingEnabled::kNo) {
96 auto builder = CreateStandardRuntimeBuilder(
97 internal::GetTestingDescriptorPool(), options);
98 ABSL_CHECK_OK(builder.status());
99
100 switch (const_folding) {
101 case ConstFoldingEnabled::kNo:
102 break;
103 case ConstFoldingEnabled::kYes:
104 ABSL_CHECK(arena != nullptr);
105 ABSL_CHECK_OK(extensions::EnableConstantFolding(*builder));
106 break;
107 }
108
109 auto runtime = std::move(builder).value().Build();
110 ABSL_CHECK_OK(runtime.status());
111 return std::move(runtime).value();
112}
113
114template <typename T>
115Value WrapMessageOrDie(const T& message, google::protobuf::Arena* absl_nonnull arena) {

Callers 15

BM_EvalFunction · 0.85
BM_Eval_TraceFunction · 0.85
BM_EvalStringFunction · 0.85
BM_EvalString_TraceFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85
BM_Comprehension_TraceFunction · 0.85
BM_HasMapFunction · 0.85
BM_HasProtoFunction · 0.85
BM_HasProtoMapFunction · 0.85
BM_ListComprehensionFunction · 0.85

Calls 4

EnableConstantFoldingFunction · 0.85
BuildMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected