Skip to content

Commit

Permalink
Remove descriptor_legacy usage from C++ runtime
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588915020
  • Loading branch information
mkruskal-google authored and copybara-github committed Dec 7, 2023
1 parent 43f92cb commit 17f4f91
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 165 deletions.
1 change: 0 additions & 1 deletion conformance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ cc_library(
includes = ["."],
deps = [
":conformance_cc_proto",
"//src/google/protobuf:descriptor_legacy",
"//src/google/protobuf/util:differencer",
"//src/google/protobuf/util:json_util",
"//src/google/protobuf/util:type_resolver_util",
Expand Down
12 changes: 4 additions & 8 deletions conformance/conformance_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "absl/strings/string_view.h"
#include "conformance/conformance.pb.h"
#include "conformance/conformance.pb.h"
#include "google/protobuf/descriptor_legacy.h"
#include "google/protobuf/message.h"
#include "google/protobuf/text_format.h"

Expand Down Expand Up @@ -143,13 +142,12 @@ ConformanceTestSuite::ConformanceRequestSetting::NewTestMessage() const {

std::string
ConformanceTestSuite::ConformanceRequestSetting::GetSyntaxIdentifier() const {
switch (FileDescriptorLegacy(prototype_message_.GetDescriptor()->file())
.syntax()) {
case FileDescriptorLegacy::Syntax::SYNTAX_PROTO3:
switch (prototype_message_.GetDescriptor()->file()->edition()) {
case Edition::EDITION_PROTO3:
return "Proto3";
case FileDescriptorLegacy::Syntax::SYNTAX_PROTO2:
case Edition::EDITION_PROTO2:
return "Proto2";
case FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS: {
default: {
std::string id = "Editions";
if (prototype_message_.GetDescriptor()->name() == "TestAllTypesProto2") {
absl::StrAppend(&id, "_Proto2");
Expand All @@ -159,8 +157,6 @@ ConformanceTestSuite::ConformanceRequestSetting::GetSyntaxIdentifier() const {
}
return id;
}
default:
return "Unknown";
}
}

Expand Down
1 change: 0 additions & 1 deletion src/google/protobuf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ cc_library(
"descriptor.h",
"descriptor.pb.h",
"descriptor_database.h",
"descriptor_legacy.h",
"descriptor_visitor.h",
"dynamic_message.h",
"feature_resolver.h",
Expand Down
Loading

0 comments on commit 17f4f91

Please sign in to comment.