Skip to content

Commit e08ab65

Browse files
jckingcopybara-github
authored andcommitted
Remove cel::Data, cel::ReferenceCount, and related internal primitives
PiperOrigin-RevId: 994577785
1 parent 0f312ae commit e08ab65

12 files changed

Lines changed: 4 additions & 1018 deletions

‎common/BUILD‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -894,18 +894,11 @@ cc_library(
894894
],
895895
)
896896

897-
cc_library(
898-
name = "reference_count",
899-
hdrs = ["reference_count.h"],
900-
deps = ["//common/internal:reference_count"],
901-
)
902-
903897
cc_library(
904898
name = "allocator",
905899
hdrs = ["allocator.h"],
906900
deps = [
907901
":arena",
908-
":data",
909902
"//internal:new",
910903
"@com_google_absl//absl/base:core_headers",
911904
"@com_google_absl//absl/base:nullability",
@@ -927,29 +920,6 @@ cc_test(
927920
],
928921
)
929922

930-
cc_library(
931-
name = "data",
932-
hdrs = ["data.h"],
933-
deps = [
934-
"//common/internal:metadata",
935-
"@com_google_absl//absl/base:nullability",
936-
"@com_google_absl//absl/log:absl_check",
937-
"@com_google_protobuf//:protobuf",
938-
],
939-
)
940-
941-
cc_test(
942-
name = "data_test",
943-
srcs = ["data_test.cc"],
944-
deps = [
945-
":data",
946-
"//common/internal:reference_count",
947-
"//internal:testing",
948-
"@com_google_absl//absl/base:nullability",
949-
"@com_google_protobuf//:protobuf",
950-
],
951-
)
952-
953923
cc_library(
954924
name = "optional_ref",
955925
hdrs = ["optional_ref.h"],

‎common/allocator.h‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "absl/log/die_if_null.h"
2828
#include "absl/numeric/bits.h"
2929
#include "common/arena.h"
30-
#include "common/data.h"
3130
#include "internal/new.h"
3231
#include "google/protobuf/arena.h"
3332

@@ -291,9 +290,6 @@ class ArenaAllocator<void> {
291290
using U = std::remove_const_t<T>;
292291
U* object;
293292
if constexpr (google::protobuf::Arena::is_arena_constructable<U>::value) {
294-
// Classes derived from `cel::Data` are manually allocated and constructed
295-
// as those class support determining whether the destructor is skippable
296-
// at runtime.
297293
object = google::protobuf::Arena::Create<U>(arena(), std::forward<Args>(args)...);
298294
} else {
299295
if constexpr (ArenaTraits<>::constructible<U>()) {
@@ -309,8 +305,7 @@ class ArenaAllocator<void> {
309305
}
310306
}
311307
}
312-
if constexpr (google::protobuf::Arena::is_arena_constructable<U>::value ||
313-
std::is_base_of_v<Data, U>) {
308+
if constexpr (google::protobuf::Arena::is_arena_constructable<U>::value) {
314309
ABSL_DCHECK_EQ(object->GetArena(), arena());
315310
}
316311
return object;
@@ -322,8 +317,7 @@ class ArenaAllocator<void> {
322317
void delete_object(T* p) noexcept {
323318
using U = std::remove_const_t<T>;
324319
ABSL_DCHECK(p != nullptr);
325-
if constexpr (google::protobuf::Arena::is_arena_constructable<U>::value ||
326-
std::is_base_of_v<Data, U>) {
320+
if constexpr (google::protobuf::Arena::is_arena_constructable<U>::value) {
327321
ABSL_DCHECK_EQ(p->GetArena(), arena());
328322
}
329323
}

‎common/data.h‎

Lines changed: 0 additions & 120 deletions
This file was deleted.

‎common/data_test.cc‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎common/internal/BUILD‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,6 @@ cc_library(
2828
],
2929
)
3030

31-
cc_library(
32-
name = "reference_count",
33-
srcs = ["reference_count.cc"],
34-
hdrs = ["reference_count.h"],
35-
deps = [
36-
"//common:data",
37-
"//internal:new",
38-
"@com_google_absl//absl/base:core_headers",
39-
"@com_google_absl//absl/base:nullability",
40-
"@com_google_absl//absl/log:absl_check",
41-
"@com_google_absl//absl/strings:string_view",
42-
"@com_google_protobuf//:protobuf",
43-
],
44-
)
45-
46-
cc_test(
47-
name = "reference_count_test",
48-
srcs = ["reference_count_test.cc"],
49-
deps = [
50-
":reference_count",
51-
"//common:data",
52-
"//internal:testing",
53-
"@com_google_absl//absl/base:nullability",
54-
"@com_google_protobuf//:protobuf",
55-
"@com_google_protobuf//:struct_cc_proto",
56-
],
57-
)
58-
59-
cc_library(
60-
name = "metadata",
61-
hdrs = ["metadata.h"],
62-
deps = ["@com_google_protobuf//:protobuf"],
63-
)
64-
6531
cc_library(
6632
name = "byte_string",
6733
srcs = ["byte_string.cc"],

‎common/internal/metadata.h‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)