upb: move upb_Message definition back into upb/message/

PiperOrigin-RevId: 598741329
pull/15432/head
Eric Salo 11 months ago committed by Copybara-Service
parent 854ca49520
commit 72275ded70
  1. 3
      upb/BUILD
  2. 16
      upb/message/BUILD
  3. 1
      upb/message/internal/accessors.h
  4. 1
      upb/message/internal/extension.c
  5. 8
      upb/message/internal/map_entry.h
  6. 2
      upb/message/internal/map_sorter.h
  7. 1
      upb/message/internal/message.c
  8. 5
      upb/message/internal/message.h
  9. 10
      upb/message/internal/types.h
  10. 1
      upb/message/message.c
  11. 1
      upb/mini_descriptor/BUILD
  12. 4
      upb/mini_descriptor/decode.c
  13. 3
      upb/mini_table/BUILD
  14. 2
      upb/mini_table/internal/message.c
  15. 2
      upb/mini_table/internal/message.h
  16. 2
      upb/reflection/stage0/google/protobuf/descriptor.upb.h
  17. 2
      upb/text/BUILD
  18. 2
      upb/text/encode.c
  19. 1
      upb/wire/BUILD
  20. 2
      upb/wire/decode.c
  21. 2
      upb/wire/encode.c

@ -281,6 +281,7 @@ upb_amalgamation(
"//upb/lex:lex",
"//upb/mem:internal",
"//upb/message:internal",
"//upb/message:types",
"//upb/mini_descriptor:internal",
"//upb/mini_table:internal",
"//upb/reflection:internal",
@ -326,6 +327,7 @@ upb_amalgamation(
"//upb/lex:lex",
"//upb/mem:internal",
"//upb/message:internal",
"//upb/message:types",
"//upb/mini_descriptor:internal",
"//upb/mini_table:internal",
"//upb/reflection:internal",
@ -372,6 +374,7 @@ upb_amalgamation(
"//upb/lex:lex",
"//upb/mem:internal",
"//upb/message:internal",
"//upb/message:types",
"//upb/mini_descriptor:internal",
"//upb/mini_table:internal",
"//upb/reflection:internal",

@ -40,6 +40,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":internal",
":types",
"//upb:base",
"//upb:mem",
"//upb:mini_table",
@ -67,6 +68,7 @@ cc_library(
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":types",
"//upb:base",
"//upb:mem",
"//upb:mini_table",
@ -155,6 +157,20 @@ cc_library(
],
)
cc_library(
name = "types",
hdrs = [
"internal/map_entry.h",
"internal/types.h",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
"//upb:base",
"//upb/hash",
],
)
proto_library(
name = "message_test_proto",
testonly = 1,

@ -19,6 +19,7 @@
#include "upb/message/internal/map.h"
#include "upb/message/internal/message.h"
#include "upb/message/internal/tagged_ptr.h"
#include "upb/message/internal/types.h"
#include "upb/mini_table/extension.h"
#include "upb/mini_table/field.h"
#include "upb/mini_table/internal/field.h"

@ -12,6 +12,7 @@
#include "upb/mem/arena.h"
#include "upb/message/internal/extension.h"
#include "upb/message/internal/message.h"
#include "upb/message/internal/types.h"
#include "upb/mini_table/extension.h"
// Must be last.

@ -5,14 +5,14 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#ifndef UPB_MINI_TABLE_INTERNAL_MAP_ENTRY_H_
#define UPB_MINI_TABLE_INTERNAL_MAP_ENTRY_H_
#ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
#define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
#include <stdint.h>
#include "upb/base/string_view.h"
#include "upb/hash/common.h"
#include "upb/mini_table/internal/types.h"
#include "upb/message/internal/types.h"
// Map entries aren't actually stored for map fields, they are only used during
// parsing. (It helps a lot if all map entry messages have the same layout.)
@ -38,4 +38,4 @@ typedef struct {
} v;
} upb_MapEntry;
#endif // UPB_MINI_TABLE_INTERNAL_MAP_ENTRY_H_
#endif // UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_

@ -17,7 +17,7 @@
#include "upb/mem/alloc.h"
#include "upb/message/internal/extension.h"
#include "upb/message/internal/map.h"
#include "upb/mini_table/internal/map_entry.h"
#include "upb/message/internal/map_entry.h"
// Must be last.
#include "upb/port/def.inc"

@ -12,6 +12,7 @@
#include "upb/base/internal/log2.h"
#include "upb/mem/arena.h"
#include "upb/message/internal/types.h"
// Must be last.
#include "upb/port/def.inc"

@ -20,7 +20,6 @@
#include "upb/mem/arena.h"
#include "upb/message/internal/extension.h"
#include "upb/mini_table/internal/types.h"
#include "upb/mini_table/message.h"
// Must be last.
@ -56,8 +55,8 @@ typedef struct upb_Message_Internal {
* extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
uint32_t unknown_end;
uint32_t ext_begin;
/* Data follows, as if there were an array:
* char data[size - sizeof(upb_Message_Internal)]; */
// Data follows, as if there were an array:
// char data[size - sizeof(upb_Message_Internal)];
} upb_Message_Internal;
// Inline version upb_Message_New(), for internal use.

@ -5,12 +5,8 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#ifndef UPB_MINI_TABLE_INTERNAL_TYPES_H_
#define UPB_MINI_TABLE_INTERNAL_TYPES_H_
// This definition exists here (instead of in upb/message/) as an optimization
// so that minitable code can cleanly know the size of a upb_Message - which is
// also the minimum size of a minitable.
#ifndef UPB_MESSAGE_INTERNAL_TYPES_H_
#define UPB_MESSAGE_INTERNAL_TYPES_H_
struct upb_Message {
union {
@ -19,4 +15,4 @@ struct upb_Message {
};
};
#endif /* UPB_MINI_TABLE_INTERNAL_TYPES_H_ */
#endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */

@ -13,6 +13,7 @@
#include "upb/mem/arena.h"
#include "upb/message/internal/message.h"
#include "upb/message/internal/types.h"
#include "upb/mini_table/message.h"
// Must be last.

@ -25,6 +25,7 @@ cc_library(
"//upb:mini_table",
"//upb:port",
"//upb/base:internal",
"//upb/message:types",
"//upb/mini_table:internal",
],
)

@ -17,6 +17,8 @@
#include "upb/base/status.h"
#include "upb/base/string_view.h"
#include "upb/mem/arena.h"
#include "upb/message/internal/map_entry.h"
#include "upb/message/internal/types.h"
#include "upb/mini_descriptor/internal/base92.h"
#include "upb/mini_descriptor/internal/decoder.h"
#include "upb/mini_descriptor/internal/modifiers.h"
@ -24,9 +26,7 @@
#include "upb/mini_table/extension.h"
#include "upb/mini_table/field.h"
#include "upb/mini_table/internal/field.h"
#include "upb/mini_table/internal/map_entry.h"
#include "upb/mini_table/internal/message.h"
#include "upb/mini_table/internal/types.h"
#include "upb/mini_table/message.h"
#include "upb/mini_table/sub.h"

@ -46,11 +46,9 @@ cc_library(
"internal/extension.h",
"internal/field.h",
"internal/file.h",
"internal/map_entry.h",
"internal/message.h",
"internal/size_log2.h",
"internal/sub.h",
"internal/types.h",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
@ -59,6 +57,7 @@ cc_library(
"//upb:mem",
"//upb:port",
"//upb/hash",
"//upb/message:types",
],
)

@ -9,7 +9,7 @@
#include <stddef.h>
#include "upb/mini_table/internal/types.h"
#include "upb/message/internal/types.h"
// Must be last.
#include "upb/port/def.inc"

@ -12,12 +12,12 @@
#include "upb/mini_table/internal/field.h"
#include "upb/mini_table/internal/sub.h"
#include "upb/mini_table/internal/types.h"
// Must be last.
#include "upb/port/def.inc"
struct upb_Decoder;
struct upb_Message;
typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
struct upb_Message* msg, intptr_t table,
uint64_t hasbits, uint64_t data);

@ -6532,7 +6532,7 @@ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google
/* Max size 32 is google.protobuf.FileOptions */
/* Max size 64 is google.protobuf.FileOptions */
#define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192)
#define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200)
#ifdef __cplusplus
} /* extern "C" */

@ -27,7 +27,7 @@ cc_library(
"//upb:wire_reader",
"//upb/lex",
"//upb/message:internal",
"//upb/mini_table:internal",
"//upb/message:types",
],
)

@ -18,11 +18,11 @@
#include "upb/base/string_view.h"
#include "upb/lex/round_trip.h"
#include "upb/message/array.h"
#include "upb/message/internal/map_entry.h"
#include "upb/message/internal/map_sorter.h"
#include "upb/message/map.h"
#include "upb/message/message.h"
#include "upb/message/value.h"
#include "upb/mini_table/internal/map_entry.h"
#include "upb/port/vsnprintf_compat.h"
#include "upb/reflection/def.h"
#include "upb/reflection/message.h"

@ -36,6 +36,7 @@ cc_library(
"//upb/hash",
"//upb/mem:internal",
"//upb/message:internal",
"//upb/message:types",
"//upb/mini_table:internal",
],
)

@ -23,6 +23,7 @@
#include "upb/message/internal/array.h"
#include "upb/message/internal/extension.h"
#include "upb/message/internal/map.h"
#include "upb/message/internal/map_entry.h"
#include "upb/message/internal/message.h"
#include "upb/message/internal/tagged_ptr.h"
#include "upb/message/map.h"
@ -33,7 +34,6 @@
#include "upb/mini_table/extension_registry.h"
#include "upb/mini_table/field.h"
#include "upb/mini_table/internal/field.h"
#include "upb/mini_table/internal/map_entry.h"
#include "upb/mini_table/internal/message.h"
#include "upb/mini_table/internal/size_log2.h"
#include "upb/mini_table/message.h"

@ -25,6 +25,7 @@
#include "upb/message/internal/array.h"
#include "upb/message/internal/extension.h"
#include "upb/message/internal/map.h"
#include "upb/message/internal/map_entry.h"
#include "upb/message/internal/map_sorter.h"
#include "upb/message/internal/tagged_ptr.h"
#include "upb/message/map.h"
@ -33,7 +34,6 @@
#include "upb/mini_table/extension.h"
#include "upb/mini_table/field.h"
#include "upb/mini_table/internal/field.h"
#include "upb/mini_table/internal/map_entry.h"
#include "upb/mini_table/internal/message.h"
#include "upb/mini_table/message.h"
#include "upb/mini_table/sub.h"

Loading…
Cancel
Save