| 342 | class LegacyConformanceServiceImpl : public ConformanceServiceInterface { |
| 343 | public: |
| 344 | static absl::StatusOr<std::unique_ptr<LegacyConformanceServiceImpl>> Create( |
| 345 | bool optimize, bool recursive, bool select_optimization) { |
| 346 | static auto* constant_arena = new Arena(); |
| 347 | |
| 348 | google::protobuf::LinkMessageReflection< |
| 349 | cel::expr::conformance::proto3::TestAllTypes>(); |
| 350 | google::protobuf::LinkMessageReflection< |
| 351 | cel::expr::conformance::proto2::TestAllTypes>(); |
| 352 | google::protobuf::LinkMessageReflection< |
| 353 | cel::expr::conformance::proto3::NestedTestAllTypes>(); |
| 354 | google::protobuf::LinkMessageReflection< |
| 355 | cel::expr::conformance::proto2::NestedTestAllTypes>(); |
| 356 | google::protobuf::LinkExtensionReflection(cel::expr::conformance::proto2::int32_ext); |
| 357 | google::protobuf::LinkExtensionReflection(cel::expr::conformance::proto2::nested_ext); |
| 358 | google::protobuf::LinkExtensionReflection( |
| 359 | cel::expr::conformance::proto2::test_all_types_ext); |
| 360 | google::protobuf::LinkExtensionReflection( |
| 361 | cel::expr::conformance::proto2::nested_enum_ext); |
| 362 | google::protobuf::LinkExtensionReflection( |
| 363 | cel::expr::conformance::proto2::repeated_test_all_types); |
| 364 | google::protobuf::LinkExtensionReflection( |
| 365 | cel::expr::conformance::proto2::Proto2ExtensionScopedMessage:: |
| 366 | int64_ext); |
| 367 | google::protobuf::LinkExtensionReflection( |
| 368 | cel::expr::conformance::proto2::Proto2ExtensionScopedMessage:: |
| 369 | message_scoped_nested_ext); |
| 370 | google::protobuf::LinkExtensionReflection( |
| 371 | cel::expr::conformance::proto2::Proto2ExtensionScopedMessage:: |
| 372 | nested_enum_ext); |
| 373 | google::protobuf::LinkExtensionReflection( |
| 374 | cel::expr::conformance::proto2::Proto2ExtensionScopedMessage:: |
| 375 | message_scoped_repeated_test_all_types); |
| 376 | |
| 377 | InterpreterOptions options; |
| 378 | options.enable_qualified_type_identifiers = true; |
| 379 | options.enable_timestamp_duration_overflow_errors = true; |
| 380 | options.enable_heterogeneous_equality = true; |
| 381 | options.enable_empty_wrapper_null_unboxing = true; |
| 382 | options.enable_qualified_identifier_rewrites = true; |
| 383 | options.fail_on_warnings = false; |
| 384 | |
| 385 | if (optimize) { |
| 386 | std::cerr << "Enabling optimizations" << std::endl; |
| 387 | options.constant_folding = true; |
| 388 | options.constant_arena = constant_arena; |
| 389 | } |
| 390 | |
| 391 | if (select_optimization) { |
| 392 | std::cerr << "Enabling select optimizations" << std::endl; |
| 393 | options.enable_select_optimization = true; |
| 394 | } |
| 395 | |
| 396 | if (recursive) { |
| 397 | options.max_recursion_depth = 48; |
| 398 | } |
| 399 | |
| 400 | std::unique_ptr<CelExpressionBuilder> builder = |
| 401 | CreateCelExpressionBuilder(options); |
nothing calls this directly
no test coverage detected