Skip to content

Commit

Permalink
Internal Change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 718929114
  • Loading branch information
tonyliaoss authored and copybara-github committed Jan 30, 2025
1 parent 79287c9 commit 7b11b89
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/google/protobuf/message_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,25 @@ class PROTOBUF_EXPORT MessageLite {
return tc_table;
}

// TODO: For now, we return a void* to avoid taking a dependency
// to the V2 parse table header. This will require an additional
// reinterpret_cast in the V2 parse loop. When we start feeling confident in
// the V2 implementation, we can work on making this function return the
// proper type (should be internal::v2::ParseTableBase*).
const void* GetV2ParseTable() const {
auto* data = GetClassData();
ABSL_DCHECK(data != nullptr);

auto* table = data->v2_parse_table;
// TODO: The V1 implementation has a descriptor method that can
// get TC table for custom vtable implementation:
// http://google3/third_party/protobuf/message_lite.h;l=490;rcl=718025165
//
// Eventually, we should also support that for V2 parse.
ABSL_DCHECK(table != nullptr);
return table;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
explicit constexpr MessageLite(const internal::ClassData* data)
: _class_data_(data) {}
Expand Down

0 comments on commit 7b11b89

Please sign in to comment.