google-protobuf 3.21.10 → 3.21.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -91,21 +91,22 @@
91
91
  #define UPB_INLINE static
92
92
  #endif
93
93
 
94
+ #define UPB_MALLOC_ALIGN 8
94
95
  #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align))
95
96
  #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align))
96
- #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, 16)
97
+ #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN)
97
98
  #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
98
99
 
99
- /* Hints to the compiler about likely/unlikely branches. */
100
+ // Hints to the compiler about likely/unlikely branches.
100
101
  #if defined (__GNUC__) || defined(__clang__)
101
- #define UPB_LIKELY(x) __builtin_expect((x),1)
102
- #define UPB_UNLIKELY(x) __builtin_expect((x),0)
102
+ #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1)
103
+ #define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0)
103
104
  #else
104
105
  #define UPB_LIKELY(x) (x)
105
106
  #define UPB_UNLIKELY(x) (x)
106
107
  #endif
107
108
 
108
- /* Macros for function attributes on compilers that support them. */
109
+ // Macros for function attributes on compilers that support them.
109
110
  #ifdef __GNUC__
110
111
  #define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
111
112
  #define UPB_NOINLINE __attribute__((noinline))
@@ -128,8 +129,7 @@
128
129
 
129
130
  #define UPB_UNUSED(var) (void)var
130
131
 
131
- /* UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
132
- */
132
+ // UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
133
133
  #ifdef NDEBUG
134
134
  #ifdef __GNUC__
135
135
  #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
@@ -263,13 +263,37 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
263
263
  #define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 0
264
264
  #endif
265
265
 
266
- /** upb/decode.h ************************************************************/
266
+ /** upb/collections.h ************************************************************/
267
+ #ifndef UPB_COLLECTIONS_H_
268
+ #define UPB_COLLECTIONS_H_
269
+
270
+
271
+ /** google/protobuf/descriptor.upb.h ************************************************************//* This file was generated by upbc (the upb compiler) from the input
272
+ * file:
273
+ *
274
+ * google/protobuf/descriptor.proto
275
+ *
276
+ * Do not edit -- your changes will be discarded when the file is
277
+ * regenerated. */
278
+
279
+ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
280
+ #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
281
+
282
+
283
+ /** upb/msg_internal.h ************************************************************/
267
284
  /*
268
- * upb_decode: parsing into a upb_Message using a upb_MiniTable.
269
- */
285
+ ** Our memory representation for parsing tables and messages themselves.
286
+ ** Functions in this file are used by generated code and possibly reflection.
287
+ **
288
+ ** The definitions in this file are internal to upb.
289
+ **/
270
290
 
271
- #ifndef UPB_DECODE_H_
272
- #define UPB_DECODE_H_
291
+ #ifndef UPB_MSG_INT_H_
292
+ #define UPB_MSG_INT_H_
293
+
294
+ #include <stdint.h>
295
+ #include <stdlib.h>
296
+ #include <string.h>
273
297
 
274
298
 
275
299
  /** upb/msg.h ************************************************************/
@@ -458,18 +482,14 @@ UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) {
458
482
  return (size_t)(h->end - h->ptr);
459
483
  }
460
484
 
461
- UPB_INLINE void* upb_Arena_Malloc(upb_Arena* a, size_t size) {
485
+ UPB_INLINE void* _upb_Arena_FastMalloc(upb_Arena* a, size_t size) {
462
486
  _upb_ArenaHead* h = (_upb_ArenaHead*)a;
463
- void* ret;
464
- size = UPB_ALIGN_MALLOC(size);
465
-
466
- if (UPB_UNLIKELY(_upb_ArenaHas(a) < size)) {
467
- return _upb_Arena_SlowMalloc(a, size);
468
- }
487
+ void* ret = h->ptr;
488
+ UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
489
+ UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
490
+ UPB_UNPOISON_MEMORY_REGION(ret, size);
469
491
 
470
- ret = h->ptr;
471
492
  h->ptr += size;
472
- UPB_UNPOISON_MEMORY_REGION(ret, size);
473
493
 
474
494
  #if UPB_ASAN
475
495
  {
@@ -485,6 +505,16 @@ UPB_INLINE void* upb_Arena_Malloc(upb_Arena* a, size_t size) {
485
505
  return ret;
486
506
  }
487
507
 
508
+ UPB_INLINE void* upb_Arena_Malloc(upb_Arena* a, size_t size) {
509
+ size = UPB_ALIGN_MALLOC(size);
510
+
511
+ if (UPB_UNLIKELY(_upb_ArenaHas(a) < size)) {
512
+ return _upb_Arena_SlowMalloc(a, size);
513
+ }
514
+
515
+ return _upb_Arena_FastMalloc(a, size);
516
+ }
517
+
488
518
  // Shrinks the last alloc from arena.
489
519
  // REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
490
520
  // We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
@@ -504,17 +534,22 @@ UPB_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
504
534
  _upb_ArenaHead* h = (_upb_ArenaHead*)a;
505
535
  oldsize = UPB_ALIGN_MALLOC(oldsize);
506
536
  size = UPB_ALIGN_MALLOC(size);
507
- if (size <= oldsize) {
508
- if ((char*)ptr + oldsize == h->ptr) {
509
- upb_Arena_ShrinkLast(a, ptr, oldsize, size);
537
+ bool is_most_recent_alloc = (uintptr_t)ptr + oldsize == (uintptr_t)h->ptr;
538
+
539
+ if (is_most_recent_alloc) {
540
+ ptrdiff_t diff = size - oldsize;
541
+ if ((ptrdiff_t)_upb_ArenaHas(a) >= diff) {
542
+ h->ptr += diff;
543
+ return ptr;
510
544
  }
545
+ } else if (size <= oldsize) {
511
546
  return ptr;
512
547
  }
513
548
 
514
549
  void* ret = upb_Arena_Malloc(a, size);
515
550
 
516
551
  if (ret && oldsize > 0) {
517
- memcpy(ret, ptr, oldsize);
552
+ memcpy(ret, ptr, UPB_MIN(oldsize, size));
518
553
  }
519
554
 
520
555
  return ret;
@@ -602,8 +637,8 @@ UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) {
602
637
  if (_upb_IsLittleEndian()) {
603
638
  return val;
604
639
  } else {
605
- return ((uint64_t)_upb_BigEndian_Swap32(val) << 32) |
606
- _upb_BigEndian_Swap32(val >> 32);
640
+ return ((uint64_t)_upb_BigEndian_Swap32((uint32_t)val) << 32) |
641
+ _upb_BigEndian_Swap32((uint32_t)(val >> 32));
607
642
  }
608
643
  }
609
644
 
@@ -631,8 +666,7 @@ UPB_INLINE int _upb_Log2CeilingSize(int x) { return 1 << _upb_Log2Ceiling(x); }
631
666
  extern "C" {
632
667
  #endif
633
668
 
634
- /** upb_Message
635
- * *******************************************************************/
669
+ /** upb_Message ***************************************************************/
636
670
 
637
671
  typedef void upb_Message;
638
672
 
@@ -701,92 +735,6 @@ upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
701
735
 
702
736
  #endif /* UPB_MSG_INT_H_ */
703
737
 
704
- /* Must be last. */
705
-
706
- #ifdef __cplusplus
707
- extern "C" {
708
- #endif
709
-
710
- enum {
711
- /* If set, strings will alias the input buffer instead of copying into the
712
- * arena. */
713
- kUpb_DecodeOption_AliasString = 1,
714
-
715
- /* If set, the parse will return failure if any message is missing any
716
- * required fields when the message data ends. The parse will still continue,
717
- * and the failure will only be reported at the end.
718
- *
719
- * IMPORTANT CAVEATS:
720
- *
721
- * 1. This can throw a false positive failure if an incomplete message is seen
722
- * on the wire but is later completed when the sub-message occurs again.
723
- * For this reason, a second pass is required to verify a failure, to be
724
- * truly robust.
725
- *
726
- * 2. This can return a false success if you are decoding into a message that
727
- * already has some sub-message fields present. If the sub-message does
728
- * not occur in the binary payload, we will never visit it and discover the
729
- * incomplete sub-message. For this reason, this check is only useful for
730
- * implemting ParseFromString() semantics. For MergeFromString(), a
731
- * post-parse validation step will always be necessary. */
732
- kUpb_DecodeOption_CheckRequired = 2,
733
- };
734
-
735
- #define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16)
736
-
737
- typedef enum {
738
- kUpb_DecodeStatus_Ok = 0,
739
- kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt
740
- kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed
741
- kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8
742
- kUpb_DecodeStatus_MaxDepthExceeded = 4, // Exceeded UPB_DECODE_MAXDEPTH
743
-
744
- // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
745
- // succeeded.
746
- kUpb_DecodeStatus_MissingRequired = 5,
747
- } upb_DecodeStatus;
748
-
749
- upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
750
- const upb_MiniTable* l,
751
- const upb_ExtensionRegistry* extreg, int options,
752
- upb_Arena* arena);
753
-
754
- #ifdef __cplusplus
755
- } /* extern "C" */
756
- #endif
757
-
758
-
759
- #endif /* UPB_DECODE_H_ */
760
-
761
- /** upb/decode_internal.h ************************************************************/
762
- /*
763
- * Internal implementation details of the decoder that are shared between
764
- * decode.c and decode_fast.c.
765
- */
766
-
767
- #ifndef UPB_DECODE_INT_H_
768
- #define UPB_DECODE_INT_H_
769
-
770
- #include <setjmp.h>
771
-
772
- #include "third_party/utf8_range/utf8_range.h"
773
-
774
- /** upb/msg_internal.h ************************************************************/
775
- /*
776
- ** Our memory representation for parsing tables and messages themselves.
777
- ** Functions in this file are used by generated code and possibly reflection.
778
- **
779
- ** The definitions in this file are internal to upb.
780
- **/
781
-
782
- #ifndef UPB_MSG_INT_H_
783
- #define UPB_MSG_INT_H_
784
-
785
- #include <stdint.h>
786
- #include <stdlib.h>
787
- #include <string.h>
788
-
789
-
790
738
  /** upb/table_internal.h ************************************************************/
791
739
  /*
792
740
  * upb_table
@@ -1172,20 +1120,23 @@ typedef struct {
1172
1120
  uint32_t number;
1173
1121
  uint16_t offset;
1174
1122
  int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index
1175
- uint16_t submsg_index; // undefined if descriptortype != MESSAGE/GROUP/ENUM
1123
+ uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM
1176
1124
  uint8_t descriptortype;
1177
1125
  uint8_t mode; /* upb_FieldMode | upb_LabelFlags |
1178
1126
  (upb_FieldRep << kUpb_FieldRep_Shift) */
1179
1127
  } upb_MiniTable_Field;
1180
1128
 
1129
+ #define kUpb_NoSub ((uint16_t)-1)
1130
+
1181
1131
  typedef enum {
1182
1132
  kUpb_FieldMode_Map = 0,
1183
1133
  kUpb_FieldMode_Array = 1,
1184
1134
  kUpb_FieldMode_Scalar = 2,
1185
-
1186
- kUpb_FieldMode_Mask = 3, /* Mask to isolate the mode from upb_FieldRep. */
1187
1135
  } upb_FieldMode;
1188
1136
 
1137
+ // Mask to isolate the upb_FieldMode from field.mode.
1138
+ #define kUpb_FieldMode_Mask 3
1139
+
1189
1140
  /* Extra flags on the mode field. */
1190
1141
  typedef enum {
1191
1142
  kUpb_LabelFlags_IsPacked = 4,
@@ -1236,18 +1187,6 @@ typedef struct {
1236
1187
  int value_count;
1237
1188
  } upb_MiniTable_Enum;
1238
1189
 
1239
- UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum* e,
1240
- int32_t val) {
1241
- uint32_t uval = (uint32_t)val;
1242
- if (uval < 64) return e->mask & (1 << uval);
1243
- // OPT: binary search long lists?
1244
- int n = e->value_count;
1245
- for (int i = 0; i < n; i++) {
1246
- if (e->values[i] == val) return true;
1247
- }
1248
- return false;
1249
- }
1250
-
1251
1190
  typedef union {
1252
1191
  const struct upb_MiniTable* submsg;
1253
1192
  const upb_MiniTable_Enum* subenum;
@@ -1269,7 +1208,7 @@ typedef enum {
1269
1208
  * message MessageSet {
1270
1209
  * repeated group Item = 1 {
1271
1210
  * required int32 type_id = 2;
1272
- * required string message = 3;
1211
+ * required bytes message = 3;
1273
1212
  * }
1274
1213
  * }
1275
1214
  */
@@ -1384,7 +1323,7 @@ UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* l) {
1384
1323
  UPB_INLINE upb_Message* _upb_Message_New_inl(const upb_MiniTable* l,
1385
1324
  upb_Arena* a) {
1386
1325
  size_t size = upb_msg_sizeof(l);
1387
- void* mem = upb_Arena_Malloc(a, size);
1326
+ void* mem = upb_Arena_Malloc(a, size + sizeof(upb_Message_Internal));
1388
1327
  upb_Message* msg;
1389
1328
  if (UPB_UNLIKELY(!mem)) return NULL;
1390
1329
  msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message);
@@ -1433,7 +1372,7 @@ typedef struct {
1433
1372
  /* Adds the given extension data to the given message. |ext| is copied into the
1434
1373
  * message instance. This logically replaces any previously-added extension with
1435
1374
  * this number */
1436
- upb_Message_Extension* _upb_Message_Getorcreateext(
1375
+ upb_Message_Extension* _upb_Message_GetOrCreateExtension(
1437
1376
  upb_Message* msg, const upb_MiniTable_Extension* ext, upb_Arena* arena);
1438
1377
 
1439
1378
  /* Returns an array of extensions for this message. Note: the array is
@@ -1547,8 +1486,8 @@ UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
1547
1486
 
1548
1487
  UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_size,
1549
1488
  int elem_size_lg2) {
1550
- const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), 8);
1551
- const size_t bytes = sizeof(upb_Array) + (init_size << elem_size_lg2);
1489
+ const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
1490
+ const size_t bytes = arr_size + (init_size << elem_size_lg2);
1552
1491
  upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes);
1553
1492
  if (!arr) return NULL;
1554
1493
  arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
@@ -1579,6 +1518,10 @@ UPB_INLINE bool _upb_Array_Resize(upb_Array* arr, size_t size,
1579
1518
  return true;
1580
1519
  }
1581
1520
 
1521
+ UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
1522
+ *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
1523
+ }
1524
+
1582
1525
  UPB_INLINE const void* _upb_array_accessor(const void* msg, size_t ofs,
1583
1526
  size_t* size) {
1584
1527
  const upb_Array* arr = *UPB_PTR_AT(msg, ofs, const upb_Array*);
@@ -1772,15 +1715,31 @@ UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) {
1772
1715
  return (void*)str_tabent(&it);
1773
1716
  }
1774
1717
 
1775
- UPB_INLINE bool _upb_Map_Set(upb_Map* map, const void* key, size_t key_size,
1776
- void* val, size_t val_size, upb_Arena* a) {
1718
+ typedef enum {
1719
+ // LINT.IfChange
1720
+ _kUpb_MapInsertStatus_Inserted = 0,
1721
+ _kUpb_MapInsertStatus_Replaced = 1,
1722
+ _kUpb_MapInsertStatus_OutOfMemory = 2,
1723
+ // LINT.ThenChange(//depot/google3/third_party/upb/upb/collections.h)
1724
+ } _upb_MapInsertStatus;
1725
+
1726
+ UPB_INLINE _upb_MapInsertStatus _upb_Map_Insert(upb_Map* map, const void* key,
1727
+ size_t key_size, void* val,
1728
+ size_t val_size, upb_Arena* a) {
1777
1729
  upb_StringView strkey = _upb_map_tokey(key, key_size);
1778
1730
  upb_value tabval = {0};
1779
- if (!_upb_map_tovalue(val, val_size, &tabval, a)) return false;
1731
+ if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
1732
+ return _kUpb_MapInsertStatus_OutOfMemory;
1733
+ }
1780
1734
 
1781
1735
  /* TODO(haberman): add overwrite operation to minimize number of lookups. */
1782
- upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
1783
- return upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a);
1736
+ bool removed =
1737
+ upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
1738
+ if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) {
1739
+ return _kUpb_MapInsertStatus_OutOfMemory;
1740
+ }
1741
+ return removed ? _kUpb_MapInsertStatus_Replaced
1742
+ : _kUpb_MapInsertStatus_Inserted;
1784
1743
  }
1785
1744
 
1786
1745
  UPB_INLINE bool _upb_Map_Delete(upb_Map* map, const void* key,
@@ -1822,7 +1781,8 @@ UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key,
1822
1781
  if (!*map) {
1823
1782
  *map = _upb_Map_New(arena, key_size, val_size);
1824
1783
  }
1825
- return _upb_Map_Set(*map, key, key_size, val, val_size, arena);
1784
+ return _upb_Map_Insert(*map, key, key_size, val, val_size, arena) !=
1785
+ _kUpb_MapInsertStatus_OutOfMemory;
1826
1786
  }
1827
1787
 
1828
1788
  UPB_INLINE bool _upb_msg_map_delete(upb_Message* msg, size_t ofs,
@@ -1922,258 +1882,71 @@ UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
1922
1882
 
1923
1883
  #endif /* UPB_MSG_INT_H_ */
1924
1884
 
1925
- /** upb/upb_internal.h ************************************************************/
1926
- #ifndef UPB_INT_H_
1927
- #define UPB_INT_H_
1885
+ /** upb/decode.h ************************************************************/
1886
+ /*
1887
+ * upb_decode: parsing into a upb_Message using a upb_MiniTable.
1888
+ */
1928
1889
 
1890
+ #ifndef UPB_DECODE_H_
1891
+ #define UPB_DECODE_H_
1929
1892
 
1930
- struct mem_block;
1931
- typedef struct mem_block mem_block;
1932
1893
 
1933
- struct upb_Arena {
1934
- _upb_ArenaHead head;
1935
- /* Stores cleanup metadata for this arena.
1936
- * - a pointer to the current cleanup counter.
1937
- * - a boolean indicating if there is an unowned initial block. */
1938
- uintptr_t cleanup_metadata;
1894
+ /* Must be last. */
1939
1895
 
1940
- /* Allocator to allocate arena blocks. We are responsible for freeing these
1941
- * when we are destroyed. */
1942
- upb_alloc* block_alloc;
1943
- uint32_t last_size;
1896
+ #ifdef __cplusplus
1897
+ extern "C" {
1898
+ #endif
1944
1899
 
1945
- /* When multiple arenas are fused together, each arena points to a parent
1946
- * arena (root points to itself). The root tracks how many live arenas
1947
- * reference it. */
1948
- uint32_t refcount; /* Only used when a->parent == a */
1949
- struct upb_Arena* parent;
1900
+ enum {
1901
+ /* If set, strings will alias the input buffer instead of copying into the
1902
+ * arena. */
1903
+ kUpb_DecodeOption_AliasString = 1,
1950
1904
 
1951
- /* Linked list of blocks to free/cleanup. */
1952
- mem_block *freelist, *freelist_tail;
1905
+ /* If set, the parse will return failure if any message is missing any
1906
+ * required fields when the message data ends. The parse will still continue,
1907
+ * and the failure will only be reported at the end.
1908
+ *
1909
+ * IMPORTANT CAVEATS:
1910
+ *
1911
+ * 1. This can throw a false positive failure if an incomplete message is seen
1912
+ * on the wire but is later completed when the sub-message occurs again.
1913
+ * For this reason, a second pass is required to verify a failure, to be
1914
+ * truly robust.
1915
+ *
1916
+ * 2. This can return a false success if you are decoding into a message that
1917
+ * already has some sub-message fields present. If the sub-message does
1918
+ * not occur in the binary payload, we will never visit it and discover the
1919
+ * incomplete sub-message. For this reason, this check is only useful for
1920
+ * implemting ParseFromString() semantics. For MergeFromString(), a
1921
+ * post-parse validation step will always be necessary. */
1922
+ kUpb_DecodeOption_CheckRequired = 2,
1953
1923
  };
1954
1924
 
1955
- // Encodes a float or double that is round-trippable, but as short as possible.
1956
- // These routines are not fully optimal (not guaranteed to be shortest), but are
1957
- // short-ish and match the implementation that has been used in protobuf since
1958
- // the beginning.
1959
- //
1960
- // The given buffer size must be at least kUpb_RoundTripBufferSize.
1961
- enum { kUpb_RoundTripBufferSize = 32 };
1962
- void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
1963
- void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
1925
+ #define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16)
1964
1926
 
1965
- #endif /* UPB_INT_H_ */
1927
+ typedef enum {
1928
+ kUpb_DecodeStatus_Ok = 0,
1929
+ kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt
1930
+ kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed
1931
+ kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8
1932
+ kUpb_DecodeStatus_MaxDepthExceeded = 4, // Exceeded UPB_DECODE_MAXDEPTH
1966
1933
 
1967
- /* Must be last. */
1934
+ // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
1935
+ // succeeded.
1936
+ kUpb_DecodeStatus_MissingRequired = 5,
1937
+ } upb_DecodeStatus;
1968
1938
 
1969
- #define DECODE_NOGROUP (uint32_t) - 1
1939
+ upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
1940
+ const upb_MiniTable* l,
1941
+ const upb_ExtensionRegistry* extreg, int options,
1942
+ upb_Arena* arena);
1970
1943
 
1971
- typedef struct upb_Decoder {
1972
- const char* end; /* Can read up to 16 bytes slop beyond this. */
1973
- const char* limit_ptr; /* = end + UPB_MIN(limit, 0) */
1974
- upb_Message* unknown_msg; /* If non-NULL, add unknown data at buffer flip. */
1975
- const char* unknown; /* Start of unknown data. */
1976
- const upb_ExtensionRegistry*
1977
- extreg; /* For looking up extensions during the parse. */
1978
- int limit; /* Submessage limit relative to end. */
1979
- int depth; /* Tracks recursion depth to bound stack usage. */
1980
- uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
1981
- uint16_t options;
1982
- bool missing_required;
1983
- char patch[32];
1984
- upb_Arena arena;
1985
- jmp_buf err;
1944
+ #ifdef __cplusplus
1945
+ } /* extern "C" */
1946
+ #endif
1986
1947
 
1987
- #ifndef NDEBUG
1988
- const char* debug_tagstart;
1989
- const char* debug_valstart;
1990
- #endif
1991
- } upb_Decoder;
1992
-
1993
- /* Error function that will abort decoding with longjmp(). We can't declare this
1994
- * UPB_NORETURN, even though it is appropriate, because if we do then compilers
1995
- * will "helpfully" refuse to tailcall to it
1996
- * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
1997
- * of our optimizations. That is also why we must declare it in a separate file,
1998
- * otherwise the compiler will see that it calls longjmp() and deduce that it is
1999
- * noreturn. */
2000
- const char* fastdecode_err(upb_Decoder* d, int status);
2001
-
2002
- extern const uint8_t upb_utf8_offsets[];
2003
-
2004
- UPB_INLINE
2005
- bool decode_verifyutf8_inl(const char* ptr, int len) {
2006
- const char* end = ptr + len;
2007
-
2008
- // Check 8 bytes at a time for any non-ASCII char.
2009
- while (end - ptr >= 8) {
2010
- uint64_t data;
2011
- memcpy(&data, ptr, 8);
2012
- if (data & 0x8080808080808080) goto non_ascii;
2013
- ptr += 8;
2014
- }
2015
-
2016
- // Check one byte at a time for non-ASCII.
2017
- while (ptr < end) {
2018
- if (*ptr & 0x80) goto non_ascii;
2019
- ptr++;
2020
- }
2021
-
2022
- return true;
2023
-
2024
- non_ascii:
2025
- return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
2026
- }
2027
-
2028
- const char* decode_checkrequired(upb_Decoder* d, const char* ptr,
2029
- const upb_Message* msg,
2030
- const upb_MiniTable* l);
2031
-
2032
- /* x86-64 pointers always have the high 16 bits matching. So we can shift
2033
- * left 8 and right 8 without loss of information. */
2034
- UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
2035
- return ((intptr_t)tablep << 8) | tablep->table_mask;
2036
- }
2037
-
2038
- UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
2039
- return (const upb_MiniTable*)(table >> 8);
2040
- }
2041
-
2042
- UPB_INLINE
2043
- const char* decode_isdonefallback_inl(upb_Decoder* d, const char* ptr,
2044
- int overrun, int* status) {
2045
- if (overrun < d->limit) {
2046
- /* Need to copy remaining data into patch buffer. */
2047
- UPB_ASSERT(overrun < 16);
2048
- if (d->unknown_msg) {
2049
- if (!_upb_Message_AddUnknown(d->unknown_msg, d->unknown, ptr - d->unknown,
2050
- &d->arena)) {
2051
- *status = kUpb_DecodeStatus_OutOfMemory;
2052
- return NULL;
2053
- }
2054
- d->unknown = &d->patch[0] + overrun;
2055
- }
2056
- memset(d->patch + 16, 0, 16);
2057
- memcpy(d->patch, d->end, 16);
2058
- ptr = &d->patch[0] + overrun;
2059
- d->end = &d->patch[16];
2060
- d->limit -= 16;
2061
- d->limit_ptr = d->end + d->limit;
2062
- d->options &= ~kUpb_DecodeOption_AliasString;
2063
- UPB_ASSERT(ptr < d->limit_ptr);
2064
- return ptr;
2065
- } else {
2066
- *status = kUpb_DecodeStatus_Malformed;
2067
- return NULL;
2068
- }
2069
- }
2070
-
2071
- const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, int overrun);
2072
-
2073
- UPB_INLINE
2074
- bool decode_isdone(upb_Decoder* d, const char** ptr) {
2075
- int overrun = *ptr - d->end;
2076
- if (UPB_LIKELY(*ptr < d->limit_ptr)) {
2077
- return false;
2078
- } else if (UPB_LIKELY(overrun == d->limit)) {
2079
- return true;
2080
- } else {
2081
- *ptr = decode_isdonefallback(d, *ptr, overrun);
2082
- return false;
2083
- }
2084
- }
2085
-
2086
- #if UPB_FASTTABLE
2087
- UPB_INLINE
2088
- const char* fastdecode_tagdispatch(upb_Decoder* d, const char* ptr,
2089
- upb_Message* msg, intptr_t table,
2090
- uint64_t hasbits, uint64_t tag) {
2091
- const upb_MiniTable* table_p = decode_totablep(table);
2092
- uint8_t mask = table;
2093
- uint64_t data;
2094
- size_t idx = tag & mask;
2095
- UPB_ASSUME((idx & 7) == 0);
2096
- idx >>= 3;
2097
- data = table_p->fasttable[idx].field_data ^ tag;
2098
- UPB_MUSTTAIL return table_p->fasttable[idx].field_parser(d, ptr, msg, table,
2099
- hasbits, data);
2100
- }
2101
- #endif
2102
-
2103
- UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
2104
- uint16_t tag;
2105
- memcpy(&tag, ptr, 2);
2106
- return tag;
2107
- }
2108
-
2109
- UPB_INLINE void decode_checklimit(upb_Decoder* d) {
2110
- UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
2111
- }
2112
-
2113
- UPB_INLINE int decode_pushlimit(upb_Decoder* d, const char* ptr, int size) {
2114
- int limit = size + (int)(ptr - d->end);
2115
- int delta = d->limit - limit;
2116
- decode_checklimit(d);
2117
- d->limit = limit;
2118
- d->limit_ptr = d->end + UPB_MIN(0, limit);
2119
- decode_checklimit(d);
2120
- return delta;
2121
- }
2122
-
2123
- UPB_INLINE void decode_poplimit(upb_Decoder* d, const char* ptr,
2124
- int saved_delta) {
2125
- UPB_ASSERT(ptr - d->end == d->limit);
2126
- decode_checklimit(d);
2127
- d->limit += saved_delta;
2128
- d->limit_ptr = d->end + UPB_MIN(0, d->limit);
2129
- decode_checklimit(d);
2130
- }
2131
-
2132
-
2133
- #endif /* UPB_DECODE_INT_H_ */
2134
-
2135
- /** upb/encode.h ************************************************************/
2136
- /*
2137
- * upb_Encode: parsing into a upb_Message using a upb_MiniTable.
2138
- */
2139
-
2140
- #ifndef UPB_ENCODE_H_
2141
- #define UPB_ENCODE_H_
2142
-
2143
-
2144
- /* Must be last. */
2145
-
2146
- #ifdef __cplusplus
2147
- extern "C" {
2148
- #endif
2149
1948
 
2150
- enum {
2151
- /* If set, the results of serializing will be deterministic across all
2152
- * instances of this binary. There are no guarantees across different
2153
- * binary builds.
2154
- *
2155
- * If your proto contains maps, the encoder will need to malloc()/free()
2156
- * memory during encode. */
2157
- kUpb_Encode_Deterministic = 1,
2158
-
2159
- /* When set, unknown fields are not printed. */
2160
- kUpb_Encode_SkipUnknown = 2,
2161
-
2162
- /* When set, the encode will fail if any required fields are missing. */
2163
- kUpb_Encode_CheckRequired = 4,
2164
- };
2165
-
2166
- #define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16)
2167
-
2168
- char* upb_Encode(const void* msg, const upb_MiniTable* l, int options,
2169
- upb_Arena* arena, size_t* size);
2170
-
2171
-
2172
- #ifdef __cplusplus
2173
- } /* extern "C" */
2174
- #endif
2175
-
2176
- #endif /* UPB_ENCODE_H_ */
1949
+ #endif /* UPB_DECODE_H_ */
2177
1950
 
2178
1951
  /** upb/decode_fast.h ************************************************************/
2179
1952
  // These are the specialized field parser functions for the fast parser.
@@ -2302,17 +2075,48 @@ TAGBYTES(r)
2302
2075
 
2303
2076
  #endif /* UPB_DECODE_FAST_H_ */
2304
2077
 
2305
- /** google/protobuf/descriptor.upb.h ************************************************************//* This file was generated by upbc (the upb compiler) from the input
2306
- * file:
2307
- *
2308
- * google/protobuf/descriptor.proto
2309
- *
2310
- * Do not edit -- your changes will be discarded when the file is
2311
- * regenerated. */
2078
+ /** upb/encode.h ************************************************************/
2079
+ /*
2080
+ * upb_Encode: parsing into a upb_Message using a upb_MiniTable.
2081
+ */
2082
+
2083
+ #ifndef UPB_ENCODE_H_
2084
+ #define UPB_ENCODE_H_
2085
+
2086
+
2087
+ /* Must be last. */
2088
+
2089
+ #ifdef __cplusplus
2090
+ extern "C" {
2091
+ #endif
2092
+
2093
+ enum {
2094
+ /* If set, the results of serializing will be deterministic across all
2095
+ * instances of this binary. There are no guarantees across different
2096
+ * binary builds.
2097
+ *
2098
+ * If your proto contains maps, the encoder will need to malloc()/free()
2099
+ * memory during encode. */
2100
+ kUpb_Encode_Deterministic = 1,
2101
+
2102
+ /* When set, unknown fields are not printed. */
2103
+ kUpb_Encode_SkipUnknown = 2,
2104
+
2105
+ /* When set, the encode will fail if any required fields are missing. */
2106
+ kUpb_Encode_CheckRequired = 4,
2107
+ };
2108
+
2109
+ #define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16)
2110
+
2111
+ char* upb_Encode(const void* msg, const upb_MiniTable* l, int options,
2112
+ upb_Arena* arena, size_t* size);
2312
2113
 
2313
- #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
2314
- #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
2315
2114
 
2115
+ #ifdef __cplusplus
2116
+ } /* extern "C" */
2117
+ #endif
2118
+
2119
+ #endif /* UPB_ENCODE_H_ */
2316
2120
 
2317
2121
 
2318
2122
  #ifdef __cplusplus
@@ -2494,6 +2298,9 @@ UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_pro
2494
2298
  UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
2495
2299
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
2496
2300
  }
2301
+ UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) {
2302
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
2303
+ }
2497
2304
  UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* len) {
2498
2305
  return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
2499
2306
  }
@@ -2545,65 +2352,104 @@ UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_p
2545
2352
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
2546
2353
  return _upb_hasbit(msg, 1);
2547
2354
  }
2355
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) {
2356
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2357
+ _upb_clearhas(msg, 1);
2358
+ }
2548
2359
  UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
2549
2360
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
2550
2361
  }
2551
2362
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
2552
2363
  return _upb_hasbit(msg, 2);
2553
2364
  }
2365
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) {
2366
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2367
+ _upb_clearhas(msg, 2);
2368
+ }
2554
2369
  UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
2555
2370
  return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
2556
2371
  }
2372
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) {
2373
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
2374
+ }
2557
2375
  UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2558
- return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
2376
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
2559
2377
  }
2560
2378
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
2561
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80));
2379
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
2380
+ }
2381
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) {
2382
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
2562
2383
  }
2563
2384
  UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2564
- return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len);
2385
+ return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
2565
2386
  }
2566
2387
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
2567
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88));
2388
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
2389
+ }
2390
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) {
2391
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
2568
2392
  }
2569
2393
  UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2570
- return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len);
2394
+ return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
2571
2395
  }
2572
2396
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
2573
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96));
2397
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64));
2398
+ }
2399
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) {
2400
+ _upb_array_detach(msg, UPB_SIZE(32, 64));
2574
2401
  }
2575
2402
  UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2576
- return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len);
2403
+ return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len);
2577
2404
  }
2578
2405
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
2579
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104));
2406
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72));
2407
+ }
2408
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) {
2409
+ _upb_array_detach(msg, UPB_SIZE(36, 72));
2580
2410
  }
2581
2411
  UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2582
- return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len);
2412
+ return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
2583
2413
  }
2584
2414
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
2585
2415
  return _upb_hasbit(msg, 3);
2586
2416
  }
2417
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) {
2418
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
2419
+ }
2587
2420
  UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
2588
- return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*);
2421
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const google_protobuf_FileOptions*);
2589
2422
  }
2590
2423
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2591
2424
  return _upb_hasbit(msg, 4);
2592
2425
  }
2426
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2427
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
2428
+ }
2593
2429
  UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2594
- return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*);
2430
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const google_protobuf_SourceCodeInfo*);
2431
+ }
2432
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
2433
+ _upb_array_detach(msg, UPB_SIZE(48, 96));
2595
2434
  }
2596
2435
  UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2597
- return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len);
2436
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len);
2437
+ }
2438
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
2439
+ _upb_array_detach(msg, UPB_SIZE(52, 104));
2598
2440
  }
2599
2441
  UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2600
- return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len);
2442
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len);
2601
2443
  }
2602
2444
  UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
2603
2445
  return _upb_hasbit(msg, 5);
2604
2446
  }
2447
+ UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) {
2448
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2449
+ _upb_clearhas(msg, 5);
2450
+ }
2605
2451
  UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
2606
- return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
2452
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView);
2607
2453
  }
2608
2454
 
2609
2455
  UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
@@ -2615,65 +2461,65 @@ UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_
2615
2461
  *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
2616
2462
  }
2617
2463
  UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2618
- return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
2464
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2619
2465
  }
2620
2466
  UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2621
- return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
2467
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), arena);
2622
2468
  }
2623
2469
  UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
2624
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val, arena);
2470
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &val, arena);
2625
2471
  }
2626
2472
  UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2627
- return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
2473
+ return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2628
2474
  }
2629
2475
  UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2630
- return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena);
2476
+ return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
2631
2477
  }
2632
2478
  UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2633
2479
  struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
2634
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena);
2480
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
2635
2481
  if (!ok) return NULL;
2636
2482
  return sub;
2637
2483
  }
2638
2484
  UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2639
- return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
2485
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
2640
2486
  }
2641
2487
  UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2642
- return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena);
2488
+ return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
2643
2489
  }
2644
2490
  UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2645
2491
  struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
2646
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, arena);
2492
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
2647
2493
  if (!ok) return NULL;
2648
2494
  return sub;
2649
2495
  }
2650
2496
  UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2651
- return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
2497
+ return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
2652
2498
  }
2653
2499
  UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2654
- return (google_protobuf_ServiceDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena);
2500
+ return (google_protobuf_ServiceDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
2655
2501
  }
2656
2502
  UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2657
2503
  struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena);
2658
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena);
2504
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
2659
2505
  if (!ok) return NULL;
2660
2506
  return sub;
2661
2507
  }
2662
2508
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2663
- return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
2509
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
2664
2510
  }
2665
2511
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2666
- return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), arena);
2512
+ return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
2667
2513
  }
2668
2514
  UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2669
2515
  struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2670
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, arena);
2516
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
2671
2517
  if (!ok) return NULL;
2672
2518
  return sub;
2673
2519
  }
2674
2520
  UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
2675
2521
  _upb_sethas(msg, 3);
2676
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
2522
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), google_protobuf_FileOptions*) = value;
2677
2523
  }
2678
2524
  UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2679
2525
  struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
@@ -2686,7 +2532,7 @@ UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorPro
2686
2532
  }
2687
2533
  UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
2688
2534
  _upb_sethas(msg, 4);
2689
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
2535
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), google_protobuf_SourceCodeInfo*) = value;
2690
2536
  }
2691
2537
  UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2692
2538
  struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
@@ -2698,26 +2544,26 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptor
2698
2544
  return sub;
2699
2545
  }
2700
2546
  UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2701
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
2547
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
2702
2548
  }
2703
2549
  UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2704
- return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 112), len, 2, arena);
2550
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, 2, arena);
2705
2551
  }
2706
2552
  UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
2707
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 112), 2, &val, arena);
2553
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), 2, &val, arena);
2708
2554
  }
2709
2555
  UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2710
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len);
2556
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
2711
2557
  }
2712
2558
  UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2713
- return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(60, 120), len, 2, arena);
2559
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, 2, arena);
2714
2560
  }
2715
2561
  UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
2716
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 120), 2, &val, arena);
2562
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), 2, &val, arena);
2717
2563
  }
2718
2564
  UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
2719
2565
  _upb_sethas(msg, 5);
2720
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
2566
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = value;
2721
2567
  }
2722
2568
 
2723
2569
  /* google.protobuf.DescriptorProto */
@@ -2754,57 +2600,88 @@ UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_proto
2754
2600
  UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
2755
2601
  return _upb_hasbit(msg, 1);
2756
2602
  }
2603
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) {
2604
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2605
+ _upb_clearhas(msg, 1);
2606
+ }
2757
2607
  UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
2758
2608
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
2759
2609
  }
2760
2610
  UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
2761
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
2611
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
2612
+ }
2613
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) {
2614
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
2762
2615
  }
2763
2616
  UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* len) {
2764
- return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
2617
+ return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
2765
2618
  }
2766
2619
  UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
2767
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
2620
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
2621
+ }
2622
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) {
2623
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
2768
2624
  }
2769
2625
  UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
2770
- return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
2626
+ return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
2771
2627
  }
2772
2628
  UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
2773
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
2629
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
2630
+ }
2631
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) {
2632
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
2774
2633
  }
2775
2634
  UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
2776
- return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
2635
+ return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
2777
2636
  }
2778
2637
  UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
2779
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
2638
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
2639
+ }
2640
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) {
2641
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
2780
2642
  }
2781
2643
  UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
2782
- return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
2644
+ return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
2783
2645
  }
2784
2646
  UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
2785
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64));
2647
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
2648
+ }
2649
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) {
2650
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
2786
2651
  }
2787
2652
  UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* len) {
2788
- return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len);
2653
+ return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
2789
2654
  }
2790
2655
  UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
2791
2656
  return _upb_hasbit(msg, 2);
2792
2657
  }
2658
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) {
2659
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
2660
+ }
2793
2661
  UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
2794
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_MessageOptions*);
2662
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_MessageOptions*);
2795
2663
  }
2796
2664
  UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
2797
2665
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72));
2798
2666
  }
2667
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) {
2668
+ _upb_array_detach(msg, UPB_SIZE(36, 72));
2669
+ }
2799
2670
  UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* len) {
2800
2671
  return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
2801
2672
  }
2802
2673
  UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
2803
2674
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80));
2804
2675
  }
2676
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) {
2677
+ _upb_array_detach(msg, UPB_SIZE(40, 80));
2678
+ }
2805
2679
  UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
2806
2680
  return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len);
2807
2681
  }
2682
+ UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) {
2683
+ _upb_array_detach(msg, UPB_SIZE(44, 88));
2684
+ }
2808
2685
  UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) {
2809
2686
  return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len);
2810
2687
  }
@@ -2814,68 +2691,68 @@ UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_Descrip
2814
2691
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
2815
2692
  }
2816
2693
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* len) {
2817
- return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
2694
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
2818
2695
  }
2819
2696
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2820
- return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
2697
+ return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
2821
2698
  }
2822
2699
  UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2823
2700
  struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2824
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
2701
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
2825
2702
  if (!ok) return NULL;
2826
2703
  return sub;
2827
2704
  }
2828
2705
  UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* len) {
2829
- return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2706
+ return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
2830
2707
  }
2831
2708
  UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2832
- return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
2709
+ return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
2833
2710
  }
2834
2711
  UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2835
2712
  struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
2836
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
2713
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
2837
2714
  if (!ok) return NULL;
2838
2715
  return sub;
2839
2716
  }
2840
2717
  UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* len) {
2841
- return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2718
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2842
2719
  }
2843
2720
  UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2844
- return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
2721
+ return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
2845
2722
  }
2846
2723
  UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2847
2724
  struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
2848
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
2725
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
2849
2726
  if (!ok) return NULL;
2850
2727
  return sub;
2851
2728
  }
2852
2729
  UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* len) {
2853
- return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
2730
+ return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2854
2731
  }
2855
2732
  UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2856
- return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
2733
+ return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
2857
2734
  }
2858
2735
  UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2859
2736
  struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
2860
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
2737
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
2861
2738
  if (!ok) return NULL;
2862
2739
  return sub;
2863
2740
  }
2864
2741
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* len) {
2865
- return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
2742
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
2866
2743
  }
2867
2744
  UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2868
- return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
2745
+ return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
2869
2746
  }
2870
2747
  UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2871
2748
  struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2872
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
2749
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
2873
2750
  if (!ok) return NULL;
2874
2751
  return sub;
2875
2752
  }
2876
2753
  UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
2877
2754
  _upb_sethas(msg, 2);
2878
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_MessageOptions*) = value;
2755
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_MessageOptions*) = value;
2879
2756
  }
2880
2757
  UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2881
2758
  struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
@@ -2954,18 +2831,29 @@ UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(con
2954
2831
  UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2955
2832
  return _upb_hasbit(msg, 1);
2956
2833
  }
2834
+ UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2835
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
2836
+ _upb_clearhas(msg, 1);
2837
+ }
2957
2838
  UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2958
2839
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
2959
2840
  }
2960
2841
  UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2961
2842
  return _upb_hasbit(msg, 2);
2962
2843
  }
2844
+ UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2845
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
2846
+ _upb_clearhas(msg, 2);
2847
+ }
2963
2848
  UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2964
2849
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
2965
2850
  }
2966
2851
  UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2967
2852
  return _upb_hasbit(msg, 3);
2968
2853
  }
2854
+ UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2855
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
2856
+ }
2969
2857
  UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2970
2858
  return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*);
2971
2859
  }
@@ -3026,12 +2914,20 @@ UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(cons
3026
2914
  UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
3027
2915
  return _upb_hasbit(msg, 1);
3028
2916
  }
2917
+ UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2918
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
2919
+ _upb_clearhas(msg, 1);
2920
+ }
3029
2921
  UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
3030
2922
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3031
2923
  }
3032
2924
  UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
3033
2925
  return _upb_hasbit(msg, 2);
3034
2926
  }
2927
+ UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2928
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
2929
+ _upb_clearhas(msg, 2);
2930
+ }
3035
2931
  UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
3036
2932
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
3037
2933
  }
@@ -3079,6 +2975,9 @@ UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google
3079
2975
  UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
3080
2976
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
3081
2977
  }
2978
+ UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
2979
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
2980
+ }
3082
2981
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
3083
2982
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
3084
2983
  }
@@ -3130,66 +3029,109 @@ UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_
3130
3029
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
3131
3030
  return _upb_hasbit(msg, 1);
3132
3031
  }
3032
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) {
3033
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3034
+ _upb_clearhas(msg, 1);
3035
+ }
3133
3036
  UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
3134
3037
  return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView);
3135
3038
  }
3136
3039
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3137
3040
  return _upb_hasbit(msg, 2);
3138
3041
  }
3042
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3043
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3044
+ _upb_clearhas(msg, 2);
3045
+ }
3139
3046
  UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3140
3047
  return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView);
3141
3048
  }
3142
3049
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
3143
3050
  return _upb_hasbit(msg, 3);
3144
3051
  }
3052
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) {
3053
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3054
+ _upb_clearhas(msg, 3);
3055
+ }
3145
3056
  UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
3146
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t);
3057
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3147
3058
  }
3148
3059
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
3149
3060
  return _upb_hasbit(msg, 4);
3150
3061
  }
3062
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) {
3063
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
3064
+ _upb_clearhas(msg, 4);
3065
+ }
3151
3066
  UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
3152
- return google_protobuf_FieldDescriptorProto_has_label(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) : 1;
3067
+ return google_protobuf_FieldDescriptorProto_has_label(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) : 1;
3153
3068
  }
3154
3069
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
3155
3070
  return _upb_hasbit(msg, 5);
3156
3071
  }
3072
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) {
3073
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
3074
+ _upb_clearhas(msg, 5);
3075
+ }
3157
3076
  UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
3158
- return google_protobuf_FieldDescriptorProto_has_type(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) : 1;
3077
+ return google_protobuf_FieldDescriptorProto_has_type(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) : 1;
3159
3078
  }
3160
3079
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3161
3080
  return _upb_hasbit(msg, 6);
3162
3081
  }
3082
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3083
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3084
+ _upb_clearhas(msg, 6);
3085
+ }
3163
3086
  UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3164
3087
  return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView);
3165
3088
  }
3166
3089
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3167
3090
  return _upb_hasbit(msg, 7);
3168
3091
  }
3092
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3093
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3094
+ _upb_clearhas(msg, 7);
3095
+ }
3169
3096
  UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3170
3097
  return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView);
3171
3098
  }
3172
3099
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
3173
3100
  return _upb_hasbit(msg, 8);
3174
3101
  }
3102
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) {
3103
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL;
3104
+ }
3175
3105
  UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
3176
- return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const google_protobuf_FieldOptions*);
3106
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const google_protobuf_FieldOptions*);
3177
3107
  }
3178
3108
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3179
3109
  return _upb_hasbit(msg, 9);
3180
3110
  }
3111
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3112
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
3113
+ _upb_clearhas(msg, 9);
3114
+ }
3181
3115
  UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3182
3116
  return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t);
3183
3117
  }
3184
3118
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3185
3119
  return _upb_hasbit(msg, 10);
3186
3120
  }
3121
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3122
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3123
+ _upb_clearhas(msg, 10);
3124
+ }
3187
3125
  UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3188
- return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_StringView);
3126
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView);
3189
3127
  }
3190
3128
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3191
3129
  return _upb_hasbit(msg, 11);
3192
3130
  }
3131
+ UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3132
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
3133
+ _upb_clearhas(msg, 11);
3134
+ }
3193
3135
  UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3194
3136
  return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool);
3195
3137
  }
@@ -3204,15 +3146,15 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobu
3204
3146
  }
3205
3147
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3206
3148
  _upb_sethas(msg, 3);
3207
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
3149
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3208
3150
  }
3209
3151
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3210
3152
  _upb_sethas(msg, 4);
3211
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3153
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
3212
3154
  }
3213
3155
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3214
3156
  _upb_sethas(msg, 5);
3215
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
3157
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
3216
3158
  }
3217
3159
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3218
3160
  _upb_sethas(msg, 6);
@@ -3224,7 +3166,7 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_pr
3224
3166
  }
3225
3167
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
3226
3168
  _upb_sethas(msg, 8);
3227
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), google_protobuf_FieldOptions*) = value;
3169
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), google_protobuf_FieldOptions*) = value;
3228
3170
  }
3229
3171
  UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
3230
3172
  struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
@@ -3241,7 +3183,7 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_prot
3241
3183
  }
3242
3184
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3243
3185
  _upb_sethas(msg, 10);
3244
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_StringView) = value;
3186
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = value;
3245
3187
  }
3246
3188
  UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
3247
3189
  _upb_sethas(msg, 11);
@@ -3282,12 +3224,19 @@ UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_
3282
3224
  UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
3283
3225
  return _upb_hasbit(msg, 1);
3284
3226
  }
3227
+ UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) {
3228
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3229
+ _upb_clearhas(msg, 1);
3230
+ }
3285
3231
  UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
3286
3232
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3287
3233
  }
3288
3234
  UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
3289
3235
  return _upb_hasbit(msg, 2);
3290
3236
  }
3237
+ UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) {
3238
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
3239
+ }
3291
3240
  UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
3292
3241
  return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*);
3293
3242
  }
@@ -3344,27 +3293,43 @@ UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_p
3344
3293
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
3345
3294
  return _upb_hasbit(msg, 1);
3346
3295
  }
3296
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) {
3297
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3298
+ _upb_clearhas(msg, 1);
3299
+ }
3347
3300
  UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
3348
3301
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3349
3302
  }
3350
3303
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
3351
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
3304
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
3305
+ }
3306
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) {
3307
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
3352
3308
  }
3353
3309
  UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3354
- return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
3310
+ return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
3355
3311
  }
3356
3312
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
3357
3313
  return _upb_hasbit(msg, 2);
3358
3314
  }
3315
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) {
3316
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
3317
+ }
3359
3318
  UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
3360
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_EnumOptions*);
3319
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_EnumOptions*);
3361
3320
  }
3362
3321
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
3363
3322
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
3364
3323
  }
3324
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
3325
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
3326
+ }
3365
3327
  UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3366
3328
  return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
3367
3329
  }
3330
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
3331
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
3332
+ }
3368
3333
  UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3369
3334
  return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
3370
3335
  }
@@ -3374,20 +3339,20 @@ UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_Enu
3374
3339
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3375
3340
  }
3376
3341
  UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3377
- return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
3342
+ return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
3378
3343
  }
3379
3344
  UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) {
3380
- return (google_protobuf_EnumValueDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
3345
+ return (google_protobuf_EnumValueDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
3381
3346
  }
3382
3347
  UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
3383
3348
  struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
3384
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
3349
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
3385
3350
  if (!ok) return NULL;
3386
3351
  return sub;
3387
3352
  }
3388
3353
  UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
3389
3354
  _upb_sethas(msg, 2);
3390
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_EnumOptions*) = value;
3355
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_EnumOptions*) = value;
3391
3356
  }
3392
3357
  UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
3393
3358
  struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
@@ -3454,12 +3419,20 @@ UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize
3454
3419
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3455
3420
  return _upb_hasbit(msg, 1);
3456
3421
  }
3422
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3423
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3424
+ _upb_clearhas(msg, 1);
3425
+ }
3457
3426
  UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3458
3427
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3459
3428
  }
3460
3429
  UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3461
3430
  return _upb_hasbit(msg, 2);
3462
3431
  }
3432
+ UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3433
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
3434
+ _upb_clearhas(msg, 2);
3435
+ }
3463
3436
  UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3464
3437
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
3465
3438
  }
@@ -3507,18 +3480,29 @@ UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const goo
3507
3480
  UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3508
3481
  return _upb_hasbit(msg, 1);
3509
3482
  }
3483
+ UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3484
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3485
+ _upb_clearhas(msg, 1);
3486
+ }
3510
3487
  UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3511
3488
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
3512
3489
  }
3513
3490
  UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3514
3491
  return _upb_hasbit(msg, 2);
3515
3492
  }
3493
+ UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3494
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3495
+ _upb_clearhas(msg, 2);
3496
+ }
3516
3497
  UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3517
3498
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3518
3499
  }
3519
3500
  UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3520
3501
  return _upb_hasbit(msg, 3);
3521
3502
  }
3503
+ UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3504
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
3505
+ }
3522
3506
  UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3523
3507
  return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*);
3524
3508
  }
@@ -3579,20 +3563,30 @@ UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const googl
3579
3563
  UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
3580
3564
  return _upb_hasbit(msg, 1);
3581
3565
  }
3566
+ UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) {
3567
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3568
+ _upb_clearhas(msg, 1);
3569
+ }
3582
3570
  UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
3583
3571
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3584
3572
  }
3585
3573
  UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
3586
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
3574
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
3575
+ }
3576
+ UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) {
3577
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
3587
3578
  }
3588
3579
  UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
3589
- return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
3580
+ return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
3590
3581
  }
3591
3582
  UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
3592
3583
  return _upb_hasbit(msg, 2);
3593
3584
  }
3585
+ UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) {
3586
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
3587
+ }
3594
3588
  UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
3595
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_ServiceOptions*);
3589
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_ServiceOptions*);
3596
3590
  }
3597
3591
 
3598
3592
  UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
@@ -3600,20 +3594,20 @@ UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_
3600
3594
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3601
3595
  }
3602
3596
  UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
3603
- return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
3597
+ return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
3604
3598
  }
3605
3599
  UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t len, upb_Arena* arena) {
3606
- return (google_protobuf_MethodDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
3600
+ return (google_protobuf_MethodDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
3607
3601
  }
3608
3602
  UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
3609
3603
  struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena);
3610
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
3604
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
3611
3605
  if (!ok) return NULL;
3612
3606
  return sub;
3613
3607
  }
3614
3608
  UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
3615
3609
  _upb_sethas(msg, 2);
3616
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_ServiceOptions*) = value;
3610
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_ServiceOptions*) = value;
3617
3611
  }
3618
3612
  UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
3619
3613
  struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
@@ -3659,36 +3653,59 @@ UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google
3659
3653
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
3660
3654
  return _upb_hasbit(msg, 1);
3661
3655
  }
3656
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) {
3657
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3658
+ _upb_clearhas(msg, 1);
3659
+ }
3662
3660
  UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
3663
3661
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3664
3662
  }
3665
3663
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3666
3664
  return _upb_hasbit(msg, 2);
3667
3665
  }
3666
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3667
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3668
+ _upb_clearhas(msg, 2);
3669
+ }
3668
3670
  UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3669
3671
  return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
3670
3672
  }
3671
3673
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3672
3674
  return _upb_hasbit(msg, 3);
3673
3675
  }
3676
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3677
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3678
+ _upb_clearhas(msg, 3);
3679
+ }
3674
3680
  UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3675
3681
  return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
3676
3682
  }
3677
3683
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
3678
3684
  return _upb_hasbit(msg, 4);
3679
3685
  }
3686
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) {
3687
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
3688
+ }
3680
3689
  UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
3681
3690
  return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*);
3682
3691
  }
3683
3692
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3684
3693
  return _upb_hasbit(msg, 5);
3685
3694
  }
3695
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3696
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
3697
+ _upb_clearhas(msg, 5);
3698
+ }
3686
3699
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3687
3700
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
3688
3701
  }
3689
3702
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3690
3703
  return _upb_hasbit(msg, 6);
3691
3704
  }
3705
+ UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3706
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
3707
+ _upb_clearhas(msg, 6);
3708
+ }
3692
3709
  UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3693
3710
  return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
3694
3711
  }
@@ -3761,126 +3778,209 @@ UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_
3761
3778
  UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
3762
3779
  return _upb_hasbit(msg, 1);
3763
3780
  }
3781
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) {
3782
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3783
+ _upb_clearhas(msg, 1);
3784
+ }
3764
3785
  UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
3765
3786
  return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView);
3766
3787
  }
3767
3788
  UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
3768
3789
  return _upb_hasbit(msg, 2);
3769
3790
  }
3791
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) {
3792
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3793
+ _upb_clearhas(msg, 2);
3794
+ }
3770
3795
  UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
3771
3796
  return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView);
3772
3797
  }
3773
3798
  UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
3774
3799
  return _upb_hasbit(msg, 3);
3775
3800
  }
3801
+ UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) {
3802
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3803
+ _upb_clearhas(msg, 3);
3804
+ }
3776
3805
  UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
3777
3806
  return google_protobuf_FileOptions_has_optimize_for(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) : 1;
3778
3807
  }
3779
3808
  UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
3780
3809
  return _upb_hasbit(msg, 4);
3781
3810
  }
3811
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) {
3812
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
3813
+ _upb_clearhas(msg, 4);
3814
+ }
3782
3815
  UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
3783
3816
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
3784
3817
  }
3785
3818
  UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
3786
3819
  return _upb_hasbit(msg, 5);
3787
3820
  }
3821
+ UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) {
3822
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3823
+ _upb_clearhas(msg, 5);
3824
+ }
3788
3825
  UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
3789
3826
  return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView);
3790
3827
  }
3791
3828
  UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
3792
3829
  return _upb_hasbit(msg, 6);
3793
3830
  }
3831
+ UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) {
3832
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
3833
+ _upb_clearhas(msg, 6);
3834
+ }
3794
3835
  UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
3795
3836
  return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
3796
3837
  }
3797
3838
  UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
3798
3839
  return _upb_hasbit(msg, 7);
3799
3840
  }
3841
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) {
3842
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
3843
+ _upb_clearhas(msg, 7);
3844
+ }
3800
3845
  UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
3801
3846
  return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
3802
3847
  }
3803
3848
  UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
3804
3849
  return _upb_hasbit(msg, 8);
3805
3850
  }
3851
+ UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) {
3852
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0;
3853
+ _upb_clearhas(msg, 8);
3854
+ }
3806
3855
  UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
3807
3856
  return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool);
3808
3857
  }
3809
3858
  UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3810
3859
  return _upb_hasbit(msg, 9);
3811
3860
  }
3861
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3862
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
3863
+ _upb_clearhas(msg, 9);
3864
+ }
3812
3865
  UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3813
3866
  return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
3814
3867
  }
3815
3868
  UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
3816
3869
  return _upb_hasbit(msg, 10);
3817
3870
  }
3871
+ UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) {
3872
+ *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0;
3873
+ _upb_clearhas(msg, 10);
3874
+ }
3818
3875
  UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
3819
3876
  return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool);
3820
3877
  }
3821
3878
  UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3822
3879
  return _upb_hasbit(msg, 11);
3823
3880
  }
3881
+ UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3882
+ *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = 0;
3883
+ _upb_clearhas(msg, 11);
3884
+ }
3824
3885
  UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3825
3886
  return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool);
3826
3887
  }
3827
3888
  UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3828
3889
  return _upb_hasbit(msg, 12);
3829
3890
  }
3891
+ UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3892
+ *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = 0;
3893
+ _upb_clearhas(msg, 12);
3894
+ }
3830
3895
  UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3831
3896
  return google_protobuf_FileOptions_has_cc_enable_arenas(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) : true;
3832
3897
  }
3833
3898
  UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3834
3899
  return _upb_hasbit(msg, 13);
3835
3900
  }
3901
+ UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3902
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3903
+ _upb_clearhas(msg, 13);
3904
+ }
3836
3905
  UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3837
3906
  return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView);
3838
3907
  }
3839
3908
  UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
3840
3909
  return _upb_hasbit(msg, 14);
3841
3910
  }
3911
+ UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) {
3912
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3913
+ _upb_clearhas(msg, 14);
3914
+ }
3842
3915
  UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
3843
3916
  return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView);
3844
3917
  }
3845
3918
  UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
3846
3919
  return _upb_hasbit(msg, 15);
3847
3920
  }
3921
+ UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) {
3922
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3923
+ _upb_clearhas(msg, 15);
3924
+ }
3848
3925
  UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
3849
3926
  return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView);
3850
3927
  }
3851
3928
  UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
3852
3929
  return _upb_hasbit(msg, 16);
3853
3930
  }
3931
+ UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) {
3932
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3933
+ _upb_clearhas(msg, 16);
3934
+ }
3854
3935
  UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
3855
3936
  return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView);
3856
3937
  }
3857
3938
  UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
3858
3939
  return _upb_hasbit(msg, 17);
3859
3940
  }
3941
+ UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) {
3942
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3943
+ _upb_clearhas(msg, 17);
3944
+ }
3860
3945
  UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
3861
3946
  return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView);
3862
3947
  }
3863
3948
  UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
3864
3949
  return _upb_hasbit(msg, 18);
3865
3950
  }
3951
+ UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) {
3952
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
3953
+ _upb_clearhas(msg, 18);
3954
+ }
3866
3955
  UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) {
3867
3956
  return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
3868
3957
  }
3869
3958
  UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3870
3959
  return _upb_hasbit(msg, 19);
3871
3960
  }
3961
+ UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3962
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3963
+ _upb_clearhas(msg, 19);
3964
+ }
3872
3965
  UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3873
3966
  return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView);
3874
3967
  }
3875
3968
  UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
3876
3969
  return _upb_hasbit(msg, 20);
3877
3970
  }
3971
+ UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) {
3972
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3973
+ _upb_clearhas(msg, 20);
3974
+ }
3878
3975
  UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
3879
3976
  return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView);
3880
3977
  }
3881
3978
  UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
3882
3979
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184));
3883
3980
  }
3981
+ UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) {
3982
+ _upb_array_detach(msg, UPB_SIZE(100, 184));
3983
+ }
3884
3984
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* len) {
3885
3985
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len);
3886
3986
  }
@@ -4012,30 +4112,49 @@ UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protob
4012
4112
  UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4013
4113
  return _upb_hasbit(msg, 1);
4014
4114
  }
4115
+ UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4116
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4117
+ _upb_clearhas(msg, 1);
4118
+ }
4015
4119
  UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4016
4120
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4017
4121
  }
4018
4122
  UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4019
4123
  return _upb_hasbit(msg, 2);
4020
4124
  }
4125
+ UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4126
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
4127
+ _upb_clearhas(msg, 2);
4128
+ }
4021
4129
  UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4022
4130
  return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
4023
4131
  }
4024
4132
  UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
4025
4133
  return _upb_hasbit(msg, 3);
4026
4134
  }
4135
+ UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) {
4136
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
4137
+ _upb_clearhas(msg, 3);
4138
+ }
4027
4139
  UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
4028
4140
  return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
4029
4141
  }
4030
4142
  UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
4031
4143
  return _upb_hasbit(msg, 4);
4032
4144
  }
4145
+ UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) {
4146
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
4147
+ _upb_clearhas(msg, 4);
4148
+ }
4033
4149
  UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
4034
4150
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
4035
4151
  }
4036
4152
  UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
4037
4153
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8));
4038
4154
  }
4155
+ UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
4156
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
4157
+ }
4039
4158
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* len) {
4040
4159
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
4041
4160
  }
@@ -4103,48 +4222,79 @@ UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf
4103
4222
  UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
4104
4223
  return _upb_hasbit(msg, 1);
4105
4224
  }
4225
+ UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) {
4226
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
4227
+ _upb_clearhas(msg, 1);
4228
+ }
4106
4229
  UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
4107
4230
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
4108
4231
  }
4109
4232
  UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
4110
4233
  return _upb_hasbit(msg, 2);
4111
4234
  }
4235
+ UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) {
4236
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
4237
+ _upb_clearhas(msg, 2);
4238
+ }
4112
4239
  UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
4113
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
4240
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
4114
4241
  }
4115
4242
  UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
4116
4243
  return _upb_hasbit(msg, 3);
4117
4244
  }
4245
+ UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) {
4246
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
4247
+ _upb_clearhas(msg, 3);
4248
+ }
4118
4249
  UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
4119
- return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool);
4250
+ return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
4120
4251
  }
4121
4252
  UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
4122
4253
  return _upb_hasbit(msg, 4);
4123
4254
  }
4255
+ UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) {
4256
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
4257
+ _upb_clearhas(msg, 4);
4258
+ }
4124
4259
  UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
4125
- return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool);
4260
+ return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
4126
4261
  }
4127
4262
  UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
4128
4263
  return _upb_hasbit(msg, 5);
4129
4264
  }
4265
+ UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) {
4266
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
4267
+ _upb_clearhas(msg, 5);
4268
+ }
4130
4269
  UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
4131
- return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
4270
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t);
4132
4271
  }
4133
4272
  UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
4134
4273
  return _upb_hasbit(msg, 6);
4135
4274
  }
4275
+ UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) {
4276
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
4277
+ _upb_clearhas(msg, 6);
4278
+ }
4136
4279
  UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
4137
- return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool);
4280
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
4138
4281
  }
4139
4282
  UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4140
4283
  return _upb_hasbit(msg, 7);
4141
4284
  }
4285
+ UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4286
+ *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = 0;
4287
+ _upb_clearhas(msg, 7);
4288
+ }
4142
4289
  UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4143
- return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
4290
+ return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool);
4144
4291
  }
4145
4292
  UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
4146
4293
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24));
4147
4294
  }
4295
+ UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
4296
+ _upb_array_detach(msg, UPB_SIZE(20, 24));
4297
+ }
4148
4298
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* len) {
4149
4299
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len);
4150
4300
  }
@@ -4155,27 +4305,27 @@ UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOpti
4155
4305
  }
4156
4306
  UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
4157
4307
  _upb_sethas(msg, 2);
4158
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
4308
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
4159
4309
  }
4160
4310
  UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
4161
4311
  _upb_sethas(msg, 3);
4162
- *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
4312
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
4163
4313
  }
4164
4314
  UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
4165
4315
  _upb_sethas(msg, 4);
4166
- *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
4316
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
4167
4317
  }
4168
4318
  UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
4169
4319
  _upb_sethas(msg, 5);
4170
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
4320
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
4171
4321
  }
4172
4322
  UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
4173
4323
  _upb_sethas(msg, 6);
4174
- *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value;
4324
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
4175
4325
  }
4176
4326
  UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
4177
4327
  _upb_sethas(msg, 7);
4178
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
4328
+ *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
4179
4329
  }
4180
4330
  UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* len) {
4181
4331
  return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
@@ -4224,6 +4374,9 @@ UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf
4224
4374
  UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
4225
4375
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
4226
4376
  }
4377
+ UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
4378
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
4379
+ }
4227
4380
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* len) {
4228
4381
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
4229
4382
  }
@@ -4275,18 +4428,29 @@ UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_
4275
4428
  UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
4276
4429
  return _upb_hasbit(msg, 1);
4277
4430
  }
4431
+ UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) {
4432
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4433
+ _upb_clearhas(msg, 1);
4434
+ }
4278
4435
  UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
4279
4436
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4280
4437
  }
4281
4438
  UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
4282
4439
  return _upb_hasbit(msg, 2);
4283
4440
  }
4441
+ UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) {
4442
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
4443
+ _upb_clearhas(msg, 2);
4444
+ }
4284
4445
  UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
4285
4446
  return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
4286
4447
  }
4287
4448
  UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
4288
4449
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4289
4450
  }
4451
+ UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
4452
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
4453
+ }
4290
4454
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* len) {
4291
4455
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4292
4456
  }
@@ -4346,12 +4510,19 @@ UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_prot
4346
4510
  UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
4347
4511
  return _upb_hasbit(msg, 1);
4348
4512
  }
4513
+ UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) {
4514
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4515
+ _upb_clearhas(msg, 1);
4516
+ }
4349
4517
  UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
4350
4518
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4351
4519
  }
4352
4520
  UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
4353
4521
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4354
4522
  }
4523
+ UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
4524
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
4525
+ }
4355
4526
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* len) {
4356
4527
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4357
4528
  }
@@ -4407,12 +4578,19 @@ UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protob
4407
4578
  UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
4408
4579
  return _upb_hasbit(msg, 1);
4409
4580
  }
4581
+ UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) {
4582
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4583
+ _upb_clearhas(msg, 1);
4584
+ }
4410
4585
  UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
4411
4586
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4412
4587
  }
4413
4588
  UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
4414
4589
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4415
4590
  }
4591
+ UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
4592
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
4593
+ }
4416
4594
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* len) {
4417
4595
  return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4418
4596
  }
@@ -4468,39 +4646,50 @@ UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobu
4468
4646
  UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
4469
4647
  return _upb_hasbit(msg, 1);
4470
4648
  }
4649
+ UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) {
4650
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4651
+ _upb_clearhas(msg, 1);
4652
+ }
4471
4653
  UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
4472
- return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
4654
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4473
4655
  }
4474
4656
  UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
4475
4657
  return _upb_hasbit(msg, 2);
4476
4658
  }
4659
+ UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) {
4660
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
4661
+ _upb_clearhas(msg, 2);
4662
+ }
4477
4663
  UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
4478
4664
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
4479
4665
  }
4480
4666
  UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
4481
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16));
4667
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8));
4668
+ }
4669
+ UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
4670
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
4482
4671
  }
4483
4672
  UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* len) {
4484
- return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
4673
+ return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
4485
4674
  }
4486
4675
 
4487
4676
  UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
4488
4677
  _upb_sethas(msg, 1);
4489
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
4678
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4490
4679
  }
4491
4680
  UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
4492
4681
  _upb_sethas(msg, 2);
4493
4682
  *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
4494
4683
  }
4495
4684
  UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* len) {
4496
- return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
4685
+ return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
4497
4686
  }
4498
4687
  UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t len, upb_Arena* arena) {
4499
- return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena);
4688
+ return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena);
4500
4689
  }
4501
4690
  UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
4502
4691
  struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4503
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena);
4692
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
4504
4693
  if (!ok) return NULL;
4505
4694
  return sub;
4506
4695
  }
@@ -4537,83 +4726,110 @@ UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_p
4537
4726
  return upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, options, arena, len);
4538
4727
  }
4539
4728
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
4540
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80));
4729
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4730
+ }
4731
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) {
4732
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
4541
4733
  }
4542
4734
  UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* len) {
4543
- return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(56, 80), len);
4735
+ return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4544
4736
  }
4545
4737
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4546
4738
  return _upb_hasbit(msg, 1);
4547
4739
  }
4740
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4741
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4742
+ _upb_clearhas(msg, 1);
4743
+ }
4548
4744
  UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4549
- return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_StringView);
4745
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
4550
4746
  }
4551
4747
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4552
4748
  return _upb_hasbit(msg, 2);
4553
4749
  }
4750
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4751
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0;
4752
+ _upb_clearhas(msg, 2);
4753
+ }
4554
4754
  UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4555
- return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t);
4755
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t);
4556
4756
  }
4557
4757
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4558
4758
  return _upb_hasbit(msg, 3);
4559
4759
  }
4760
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4761
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = 0;
4762
+ _upb_clearhas(msg, 3);
4763
+ }
4560
4764
  UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4561
- return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t);
4765
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t);
4562
4766
  }
4563
4767
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
4564
4768
  return _upb_hasbit(msg, 4);
4565
4769
  }
4770
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) {
4771
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = 0;
4772
+ _upb_clearhas(msg, 4);
4773
+ }
4566
4774
  UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
4567
- return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double);
4775
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double);
4568
4776
  }
4569
4777
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
4570
4778
  return _upb_hasbit(msg, 5);
4571
4779
  }
4780
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) {
4781
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4782
+ _upb_clearhas(msg, 5);
4783
+ }
4572
4784
  UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
4573
- return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_StringView);
4785
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
4574
4786
  }
4575
4787
  UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4576
4788
  return _upb_hasbit(msg, 6);
4577
4789
  }
4790
+ UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4791
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4792
+ _upb_clearhas(msg, 6);
4793
+ }
4578
4794
  UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4579
- return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_StringView);
4795
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
4580
4796
  }
4581
4797
 
4582
4798
  UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* len) {
4583
- return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 80), len);
4799
+ return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4584
4800
  }
4585
4801
  UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t len, upb_Arena* arena) {
4586
- return (google_protobuf_UninterpretedOption_NamePart**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 80), len, UPB_SIZE(2, 3), arena);
4802
+ return (google_protobuf_UninterpretedOption_NamePart**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
4587
4803
  }
4588
4804
  UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) {
4589
4805
  struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
4590
- bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 80), UPB_SIZE(2, 3), &sub, arena);
4806
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
4591
4807
  if (!ok) return NULL;
4592
4808
  return sub;
4593
4809
  }
4594
4810
  UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4595
4811
  _upb_sethas(msg, 1);
4596
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_StringView) = value;
4812
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
4597
4813
  }
4598
4814
  UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
4599
4815
  _upb_sethas(msg, 2);
4600
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
4816
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = value;
4601
4817
  }
4602
4818
  UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
4603
4819
  _upb_sethas(msg, 3);
4604
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
4820
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = value;
4605
4821
  }
4606
4822
  UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
4607
4823
  _upb_sethas(msg, 4);
4608
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
4824
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = value;
4609
4825
  }
4610
4826
  UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4611
4827
  _upb_sethas(msg, 5);
4612
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_StringView) = value;
4828
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
4613
4829
  }
4614
4830
  UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4615
4831
  _upb_sethas(msg, 6);
4616
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_StringView) = value;
4832
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value;
4617
4833
  }
4618
4834
 
4619
4835
  /* google.protobuf.UninterpretedOption.NamePart */
@@ -4650,12 +4866,20 @@ UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const
4650
4866
  UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4651
4867
  return _upb_hasbit(msg, 1);
4652
4868
  }
4869
+ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4870
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4871
+ _upb_clearhas(msg, 1);
4872
+ }
4653
4873
  UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4654
4874
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
4655
4875
  }
4656
4876
  UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4657
4877
  return _upb_hasbit(msg, 2);
4658
4878
  }
4879
+ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4880
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4881
+ _upb_clearhas(msg, 2);
4882
+ }
4659
4883
  UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4660
4884
  return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4661
4885
  }
@@ -4703,6 +4927,9 @@ UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protob
4703
4927
  UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
4704
4928
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
4705
4929
  }
4930
+ UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) {
4931
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
4932
+ }
4706
4933
  UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* len) {
4707
4934
  return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
4708
4935
  }
@@ -4751,53 +4978,70 @@ UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const goog
4751
4978
  upb_Arena* arena, size_t* len) {
4752
4979
  return upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, options, arena, len);
4753
4980
  }
4981
+ UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) {
4982
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
4983
+ }
4754
4984
  UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4755
- return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
4985
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4986
+ }
4987
+ UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) {
4988
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
4756
4989
  }
4757
4990
  UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4758
- return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
4991
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
4759
4992
  }
4760
4993
  UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4761
4994
  return _upb_hasbit(msg, 1);
4762
4995
  }
4996
+ UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4997
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4998
+ _upb_clearhas(msg, 1);
4999
+ }
4763
5000
  UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4764
- return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
5001
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
4765
5002
  }
4766
5003
  UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4767
5004
  return _upb_hasbit(msg, 2);
4768
5005
  }
5006
+ UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5007
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
5008
+ _upb_clearhas(msg, 2);
5009
+ }
4769
5010
  UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4770
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
5011
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
5012
+ }
5013
+ UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5014
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
4771
5015
  }
4772
5016
  UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4773
5017
  return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
4774
5018
  }
4775
5019
 
4776
5020
  UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4777
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
5021
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4778
5022
  }
4779
5023
  UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
4780
- return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, 2, arena);
5024
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena);
4781
5025
  }
4782
5026
  UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
4783
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), 2, &val, arena);
5027
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 2, &val, arena);
4784
5028
  }
4785
5029
  UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4786
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
5030
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
4787
5031
  }
4788
5032
  UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
4789
- return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, 2, arena);
5033
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 2, arena);
4790
5034
  }
4791
5035
  UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
4792
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), 2, &val, arena);
5036
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 2, &val, arena);
4793
5037
  }
4794
5038
  UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
4795
5039
  _upb_sethas(msg, 1);
4796
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
5040
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
4797
5041
  }
4798
5042
  UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
4799
5043
  _upb_sethas(msg, 2);
4800
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
5044
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
4801
5045
  }
4802
5046
  UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4803
5047
  return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
@@ -4843,6 +5087,9 @@ UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_pro
4843
5087
  UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
4844
5088
  return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
4845
5089
  }
5090
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
5091
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
5092
+ }
4846
5093
  UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
4847
5094
  return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
4848
5095
  }
@@ -4891,62 +5138,446 @@ UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const
4891
5138
  upb_Arena* arena, size_t* len) {
4892
5139
  return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, options, arena, len);
4893
5140
  }
5141
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5142
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
5143
+ }
4894
5144
  UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
4895
- return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len);
5145
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
4896
5146
  }
4897
5147
  UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4898
5148
  return _upb_hasbit(msg, 1);
4899
5149
  }
5150
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5151
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
5152
+ _upb_clearhas(msg, 1);
5153
+ }
4900
5154
  UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4901
- return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
5155
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
4902
5156
  }
4903
5157
  UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4904
5158
  return _upb_hasbit(msg, 2);
4905
5159
  }
5160
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5161
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
5162
+ _upb_clearhas(msg, 2);
5163
+ }
4906
5164
  UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4907
5165
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
4908
5166
  }
4909
5167
  UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4910
5168
  return _upb_hasbit(msg, 3);
4911
5169
  }
5170
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5171
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
5172
+ _upb_clearhas(msg, 3);
5173
+ }
4912
5174
  UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
4913
5175
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
4914
5176
  }
4915
5177
 
4916
5178
  UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
4917
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
5179
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
4918
5180
  }
4919
5181
  UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t len, upb_Arena* arena) {
4920
- return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, 2, arena);
5182
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena);
4921
5183
  }
4922
5184
  UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) {
4923
- return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), 2, &val, arena);
5185
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena);
4924
5186
  }
4925
5187
  UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
4926
5188
  _upb_sethas(msg, 1);
4927
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value;
5189
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
5190
+ }
5191
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
5192
+ _upb_sethas(msg, 2);
5193
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
5194
+ }
5195
+ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
5196
+ _upb_sethas(msg, 3);
5197
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
5198
+ }
5199
+
5200
+ extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout;
5201
+
5202
+ /* Max size 32 is google.protobuf.FileOptions */
5203
+ /* Max size 64 is google.protobuf.FileOptions */
5204
+ #define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192)
5205
+
5206
+ #ifdef __cplusplus
5207
+ } /* extern "C" */
5208
+ #endif
5209
+
5210
+
5211
+ #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
5212
+
5213
+ #ifdef __cplusplus
5214
+ extern "C" {
5215
+ #endif
5216
+
5217
+ typedef union {
5218
+ bool bool_val;
5219
+ float float_val;
5220
+ double double_val;
5221
+ int32_t int32_val;
5222
+ int64_t int64_val;
5223
+ uint32_t uint32_val;
5224
+ uint64_t uint64_val;
5225
+ const upb_Map* map_val;
5226
+ const upb_Message* msg_val;
5227
+ const upb_Array* array_val;
5228
+ upb_StringView str_val;
5229
+ } upb_MessageValue;
5230
+
5231
+ typedef union {
5232
+ upb_Map* map;
5233
+ upb_Message* msg;
5234
+ upb_Array* array;
5235
+ } upb_MutableMessageValue;
5236
+
5237
+ /** upb_Array *****************************************************************/
5238
+
5239
+ /* Creates a new array on the given arena that holds elements of this type. */
5240
+ upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
5241
+
5242
+ /* Returns the size of the array. */
5243
+ size_t upb_Array_Size(const upb_Array* arr);
5244
+
5245
+ /* Returns the given element, which must be within the array's current size. */
5246
+ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
5247
+
5248
+ /* Sets the given element, which must be within the array's current size. */
5249
+ void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
5250
+
5251
+ /* Appends an element to the array. Returns false on allocation failure. */
5252
+ bool upb_Array_Append(upb_Array* array, upb_MessageValue val, upb_Arena* arena);
5253
+
5254
+ /* Moves elements within the array using memmove(). Like memmove(), the source
5255
+ * and destination elements may be overlapping. */
5256
+ void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
5257
+ size_t count);
5258
+
5259
+ /* Inserts one or more empty elements into the array. Existing elements are
5260
+ * shifted right. The new elements have undefined state and must be set with
5261
+ * `upb_Array_Set()`.
5262
+ * REQUIRES: `i <= upb_Array_Size(arr)` */
5263
+ bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
5264
+ upb_Arena* arena);
5265
+
5266
+ /* Deletes one or more elements from the array. Existing elements are shifted
5267
+ * left.
5268
+ * REQUIRES: `i + count <= upb_Array_Size(arr)` */
5269
+ void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
5270
+
5271
+ /* Changes the size of a vector. New elements are initialized to empty/0.
5272
+ * Returns false on allocation failure. */
5273
+ bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
5274
+
5275
+ /** upb_Map *******************************************************************/
5276
+
5277
+ /* Creates a new map on the given arena with the given key/value size. */
5278
+ upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, upb_CType value_type);
5279
+
5280
+ /* Returns the number of entries in the map. */
5281
+ size_t upb_Map_Size(const upb_Map* map);
5282
+
5283
+ /* Stores a value for the given key into |*val| (or the zero value if the key is
5284
+ * not present). Returns whether the key was present. The |val| pointer may be
5285
+ * NULL, in which case the function tests whether the given key is present. */
5286
+ bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
5287
+ upb_MessageValue* val);
5288
+
5289
+ /* Removes all entries in the map. */
5290
+ void upb_Map_Clear(upb_Map* map);
5291
+
5292
+ typedef enum {
5293
+ // LINT.IfChange
5294
+ kUpb_MapInsertStatus_Inserted = 0,
5295
+ kUpb_MapInsertStatus_Replaced = 1,
5296
+ kUpb_MapInsertStatus_OutOfMemory = 2,
5297
+ // LINT.ThenChange(//depot/google3/third_party/upb/upb/msg_internal.h)
5298
+ } upb_MapInsertStatus;
5299
+
5300
+ /* Sets the given key to the given value, returning whether the key was inserted
5301
+ * or replaced. If the key was inserted, then any existing iterators will be
5302
+ * invalidated. */
5303
+ upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key,
5304
+ upb_MessageValue val, upb_Arena* arena);
5305
+
5306
+ /* Sets the given key to the given value. Returns false if memory allocation
5307
+ * failed. If the key is newly inserted, then any existing iterators will be
5308
+ * invalidated. */
5309
+ UPB_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
5310
+ upb_MessageValue val, upb_Arena* arena) {
5311
+ return upb_Map_Insert(map, key, val, arena) !=
5312
+ kUpb_MapInsertStatus_OutOfMemory;
5313
+ }
5314
+
5315
+ /* Deletes this key from the table. Returns true if the key was present. */
5316
+ bool upb_Map_Delete(upb_Map* map, upb_MessageValue key);
5317
+
5318
+ /* Map iteration:
5319
+ *
5320
+ * size_t iter = kUpb_Map_Begin;
5321
+ * while (upb_MapIterator_Next(map, &iter)) {
5322
+ * upb_MessageValue key = upb_MapIterator_Key(map, iter);
5323
+ * upb_MessageValue val = upb_MapIterator_Value(map, iter);
5324
+ *
5325
+ * // If mutating is desired.
5326
+ * upb_MapIterator_SetValue(map, iter, value2);
5327
+ * }
5328
+ */
5329
+
5330
+ /* Advances to the next entry. Returns false if no more entries are present. */
5331
+ bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
5332
+
5333
+ /* Returns true if the iterator still points to a valid entry, or false if the
5334
+ * iterator is past the last element. It is an error to call this function with
5335
+ * kUpb_Map_Begin (you must call next() at least once first). */
5336
+ bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
5337
+
5338
+ /* Returns the key and value for this entry of the map. */
5339
+ upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
5340
+ upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
5341
+
5342
+ /* Sets the value for this entry. The iterator must not be done, and the
5343
+ * iterator must not have been initialized const. */
5344
+ void upb_MapIterator_SetValue(upb_Map* map, size_t iter,
5345
+ upb_MessageValue value);
5346
+
5347
+ #ifdef __cplusplus
5348
+ } /* extern "C" */
5349
+ #endif
5350
+
5351
+
5352
+ #endif /* UPB_COLLECTIONS_H_ */
5353
+
5354
+ /** upb/decode_internal.h ************************************************************/
5355
+ /*
5356
+ * Internal implementation details of the decoder that are shared between
5357
+ * decode.c and decode_fast.c.
5358
+ */
5359
+
5360
+ #ifndef UPB_DECODE_INT_H_
5361
+ #define UPB_DECODE_INT_H_
5362
+
5363
+ #include <setjmp.h>
5364
+
5365
+ #include "third_party/utf8_range/utf8_range.h"
5366
+
5367
+ /** upb/upb_internal.h ************************************************************/
5368
+ #ifndef UPB_INT_H_
5369
+ #define UPB_INT_H_
5370
+
5371
+
5372
+ struct mem_block;
5373
+ typedef struct mem_block mem_block;
5374
+
5375
+ struct upb_Arena {
5376
+ _upb_ArenaHead head;
5377
+ /* Stores cleanup metadata for this arena.
5378
+ * - a pointer to the current cleanup counter.
5379
+ * - a boolean indicating if there is an unowned initial block. */
5380
+ uintptr_t cleanup_metadata;
5381
+
5382
+ /* Allocator to allocate arena blocks. We are responsible for freeing these
5383
+ * when we are destroyed. */
5384
+ upb_alloc* block_alloc;
5385
+ uint32_t last_size;
5386
+
5387
+ /* When multiple arenas are fused together, each arena points to a parent
5388
+ * arena (root points to itself). The root tracks how many live arenas
5389
+ * reference it. */
5390
+ uint32_t refcount; /* Only used when a->parent == a */
5391
+ struct upb_Arena* parent;
5392
+
5393
+ /* Linked list of blocks to free/cleanup. */
5394
+ mem_block *freelist, *freelist_tail;
5395
+ };
5396
+
5397
+ // Encodes a float or double that is round-trippable, but as short as possible.
5398
+ // These routines are not fully optimal (not guaranteed to be shortest), but are
5399
+ // short-ish and match the implementation that has been used in protobuf since
5400
+ // the beginning.
5401
+ //
5402
+ // The given buffer size must be at least kUpb_RoundTripBufferSize.
5403
+ enum { kUpb_RoundTripBufferSize = 32 };
5404
+ void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
5405
+ void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
5406
+
5407
+ #endif /* UPB_INT_H_ */
5408
+
5409
+ /* Must be last. */
5410
+
5411
+ #define DECODE_NOGROUP (uint32_t) - 1
5412
+
5413
+ typedef struct upb_Decoder {
5414
+ const char* end; /* Can read up to 16 bytes slop beyond this. */
5415
+ const char* limit_ptr; /* = end + UPB_MIN(limit, 0) */
5416
+ upb_Message* unknown_msg; /* Used for preserving unknown data. */
5417
+ const char* unknown; /* Start of unknown data, preserve at buffer flip. */
5418
+ const upb_ExtensionRegistry*
5419
+ extreg; /* For looking up extensions during the parse. */
5420
+ int limit; /* Submessage limit relative to end. */
5421
+ int depth; /* Tracks recursion depth to bound stack usage. */
5422
+ uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
5423
+ uint16_t options;
5424
+ bool missing_required;
5425
+ char patch[32];
5426
+ upb_Arena arena;
5427
+ jmp_buf err;
5428
+
5429
+ #ifndef NDEBUG
5430
+ const char* debug_tagstart;
5431
+ const char* debug_valstart;
5432
+ #endif
5433
+ } upb_Decoder;
5434
+
5435
+ /* Error function that will abort decoding with longjmp(). We can't declare this
5436
+ * UPB_NORETURN, even though it is appropriate, because if we do then compilers
5437
+ * will "helpfully" refuse to tailcall to it
5438
+ * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
5439
+ * of our optimizations. That is also why we must declare it in a separate file,
5440
+ * otherwise the compiler will see that it calls longjmp() and deduce that it is
5441
+ * noreturn. */
5442
+ const char* fastdecode_err(upb_Decoder* d, int status);
5443
+
5444
+ extern const uint8_t upb_utf8_offsets[];
5445
+
5446
+ UPB_INLINE
5447
+ bool decode_verifyutf8_inl(const char* ptr, int len) {
5448
+ const char* end = ptr + len;
5449
+
5450
+ // Check 8 bytes at a time for any non-ASCII char.
5451
+ while (end - ptr >= 8) {
5452
+ uint64_t data;
5453
+ memcpy(&data, ptr, 8);
5454
+ if (data & 0x8080808080808080) goto non_ascii;
5455
+ ptr += 8;
5456
+ }
5457
+
5458
+ // Check one byte at a time for non-ASCII.
5459
+ while (ptr < end) {
5460
+ if (*ptr & 0x80) goto non_ascii;
5461
+ ptr++;
5462
+ }
5463
+
5464
+ return true;
5465
+
5466
+ non_ascii:
5467
+ return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
5468
+ }
5469
+
5470
+ const char* decode_checkrequired(upb_Decoder* d, const char* ptr,
5471
+ const upb_Message* msg,
5472
+ const upb_MiniTable* l);
5473
+
5474
+ /* x86-64 pointers always have the high 16 bits matching. So we can shift
5475
+ * left 8 and right 8 without loss of information. */
5476
+ UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
5477
+ return ((intptr_t)tablep << 8) | tablep->table_mask;
5478
+ }
5479
+
5480
+ UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
5481
+ return (const upb_MiniTable*)(table >> 8);
5482
+ }
5483
+
5484
+ UPB_INLINE
5485
+ const char* decode_isdonefallback_inl(upb_Decoder* d, const char* ptr,
5486
+ int overrun, int* status) {
5487
+ if (overrun < d->limit) {
5488
+ /* Need to copy remaining data into patch buffer. */
5489
+ UPB_ASSERT(overrun < 16);
5490
+ if (d->unknown) {
5491
+ if (!_upb_Message_AddUnknown(d->unknown_msg, d->unknown, ptr - d->unknown,
5492
+ &d->arena)) {
5493
+ *status = kUpb_DecodeStatus_OutOfMemory;
5494
+ return NULL;
5495
+ }
5496
+ d->unknown = &d->patch[0] + overrun;
5497
+ }
5498
+ memset(d->patch + 16, 0, 16);
5499
+ memcpy(d->patch, d->end, 16);
5500
+ ptr = &d->patch[0] + overrun;
5501
+ d->end = &d->patch[16];
5502
+ d->limit -= 16;
5503
+ d->limit_ptr = d->end + d->limit;
5504
+ d->options &= ~kUpb_DecodeOption_AliasString;
5505
+ UPB_ASSERT(ptr < d->limit_ptr);
5506
+ return ptr;
5507
+ } else {
5508
+ *status = kUpb_DecodeStatus_Malformed;
5509
+ return NULL;
5510
+ }
5511
+ }
5512
+
5513
+ const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, int overrun);
5514
+
5515
+ UPB_INLINE
5516
+ bool decode_isdone(upb_Decoder* d, const char** ptr) {
5517
+ int overrun = *ptr - d->end;
5518
+ if (UPB_LIKELY(*ptr < d->limit_ptr)) {
5519
+ return false;
5520
+ } else if (UPB_LIKELY(overrun == d->limit)) {
5521
+ return true;
5522
+ } else {
5523
+ *ptr = decode_isdonefallback(d, *ptr, overrun);
5524
+ return false;
5525
+ }
5526
+ }
5527
+
5528
+ #if UPB_FASTTABLE
5529
+ UPB_INLINE
5530
+ const char* fastdecode_tagdispatch(upb_Decoder* d, const char* ptr,
5531
+ upb_Message* msg, intptr_t table,
5532
+ uint64_t hasbits, uint64_t tag) {
5533
+ const upb_MiniTable* table_p = decode_totablep(table);
5534
+ uint8_t mask = table;
5535
+ uint64_t data;
5536
+ size_t idx = tag & mask;
5537
+ UPB_ASSUME((idx & 7) == 0);
5538
+ idx >>= 3;
5539
+ data = table_p->fasttable[idx].field_data ^ tag;
5540
+ UPB_MUSTTAIL return table_p->fasttable[idx].field_parser(d, ptr, msg, table,
5541
+ hasbits, data);
5542
+ }
5543
+ #endif
5544
+
5545
+ UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
5546
+ uint16_t tag;
5547
+ memcpy(&tag, ptr, 2);
5548
+ return tag;
4928
5549
  }
4929
- UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
4930
- _upb_sethas(msg, 2);
4931
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
5550
+
5551
+ UPB_INLINE void decode_checklimit(upb_Decoder* d) {
5552
+ UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
4932
5553
  }
4933
- UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
4934
- _upb_sethas(msg, 3);
4935
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
5554
+
5555
+ UPB_INLINE int decode_pushlimit(upb_Decoder* d, const char* ptr, int size) {
5556
+ int limit = size + (int)(ptr - d->end);
5557
+ int delta = d->limit - limit;
5558
+ decode_checklimit(d);
5559
+ d->limit = limit;
5560
+ d->limit_ptr = d->end + UPB_MIN(0, limit);
5561
+ decode_checklimit(d);
5562
+ return delta;
4936
5563
  }
4937
5564
 
4938
- extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout;
5565
+ UPB_INLINE void decode_poplimit(upb_Decoder* d, const char* ptr,
5566
+ int saved_delta) {
5567
+ UPB_ASSERT(ptr - d->end == d->limit);
5568
+ decode_checklimit(d);
5569
+ d->limit += saved_delta;
5570
+ d->limit_ptr = d->end + UPB_MIN(0, d->limit);
5571
+ decode_checklimit(d);
5572
+ }
4939
5573
 
4940
- /* Max size 32 is google.protobuf.FileOptions */
4941
- /* Max size 64 is google.protobuf.FileOptions */
4942
- #define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192)
4943
5574
 
4944
- #ifdef __cplusplus
4945
- } /* extern "C" */
4946
- #endif
5575
+ #endif /* UPB_DECODE_INT_H_ */
4947
5576
 
5577
+ /** upb/json_decode.h ************************************************************/
5578
+ #ifndef UPB_JSONDECODE_H_
5579
+ #define UPB_JSONDECODE_H_
4948
5580
 
4949
- #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
4950
5581
 
4951
5582
  /** upb/def.h ************************************************************/
4952
5583
  #ifndef UPB_DEF_H_
@@ -4981,6 +5612,9 @@ struct upb_streamdef;
4981
5612
  typedef struct upb_streamdef upb_streamdef;
4982
5613
  struct upb_DefPool;
4983
5614
  typedef struct upb_DefPool upb_DefPool;
5615
+ typedef struct upb_EnumReservedRange upb_EnumReservedRange;
5616
+ typedef struct upb_MessageReservedRange upb_MessageReservedRange;
5617
+ typedef struct symtab_addctx symtab_addctx;
4984
5618
 
4985
5619
  typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax;
4986
5620
 
@@ -5084,11 +5718,11 @@ const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
5084
5718
  #define kUpb_Any_TypeFieldNumber 1
5085
5719
  #define kUpb_Any_ValueFieldNumber 2
5086
5720
 
5087
- /* Well-known field tag numbers for timestamp messages. */
5721
+ /* Well-known field tag numbers for duration messages. */
5088
5722
  #define kUpb_Duration_SecondsFieldNumber 1
5089
5723
  #define kUpb_Duration_NanosFieldNumber 2
5090
5724
 
5091
- /* Well-known field tag numbers for duration messages. */
5725
+ /* Well-known field tag numbers for timestamp messages. */
5092
5726
  #define kUpb_Timestamp_SecondsFieldNumber 1
5093
5727
  #define kUpb_Timestamp_NanosFieldNumber 2
5094
5728
 
@@ -5130,6 +5764,11 @@ UPB_INLINE bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) {
5130
5764
  return google_protobuf_MessageOptions_map_entry(upb_MessageDef_Options(m));
5131
5765
  }
5132
5766
 
5767
+ UPB_INLINE bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) {
5768
+ return google_protobuf_MessageOptions_message_set_wire_format(
5769
+ upb_MessageDef_Options(m));
5770
+ }
5771
+
5133
5772
  /* Nested entities. */
5134
5773
  int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
5135
5774
  int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
@@ -5163,6 +5802,16 @@ UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
5163
5802
  return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
5164
5803
  }
5165
5804
 
5805
+ upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i);
5806
+ int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m);
5807
+
5808
+ const upb_MessageReservedRange* upb_MessageDef_ReservedRange(
5809
+ const upb_MessageDef* m, int i);
5810
+ int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m);
5811
+
5812
+ int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r);
5813
+ int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r);
5814
+
5166
5815
  /* upb_ExtensionRange *********************************************************/
5167
5816
 
5168
5817
  const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options(
@@ -5195,6 +5844,16 @@ UPB_INLINE const upb_EnumValueDef* upb_EnumDef_FindValueByName(
5195
5844
  return upb_EnumDef_FindValueByNameWithSize(e, name, strlen(name));
5196
5845
  }
5197
5846
 
5847
+ upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
5848
+ int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
5849
+
5850
+ const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
5851
+ int i);
5852
+ int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
5853
+
5854
+ int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r);
5855
+ int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r);
5856
+
5198
5857
  /* upb_EnumValueDef ***********************************************************/
5199
5858
 
5200
5859
  const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options(
@@ -5327,6 +5986,22 @@ UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s,
5327
5986
 
5328
5987
  #endif /* UPB_DEF_H_ */
5329
5988
 
5989
+ #ifdef __cplusplus
5990
+ extern "C" {
5991
+ #endif
5992
+
5993
+ enum { upb_JsonDecode_IgnoreUnknown = 1 };
5994
+
5995
+ bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
5996
+ const upb_MessageDef* m, const upb_DefPool* symtab,
5997
+ int options, upb_Arena* arena, upb_Status* status);
5998
+
5999
+ #ifdef __cplusplus
6000
+ } /* extern "C" */
6001
+ #endif
6002
+
6003
+ #endif /* UPB_JSONDECODE_H_ */
6004
+
5330
6005
  /** upb/reflection.h ************************************************************/
5331
6006
  #ifndef UPB_REFLECTION_H_
5332
6007
  #define UPB_REFLECTION_H_
@@ -5336,26 +6011,6 @@ UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s,
5336
6011
  extern "C" {
5337
6012
  #endif
5338
6013
 
5339
- typedef union {
5340
- bool bool_val;
5341
- float float_val;
5342
- double double_val;
5343
- int32_t int32_val;
5344
- int64_t int64_val;
5345
- uint32_t uint32_val;
5346
- uint64_t uint64_val;
5347
- const upb_Map* map_val;
5348
- const upb_Message* msg_val;
5349
- const upb_Array* array_val;
5350
- upb_StringView str_val;
5351
- } upb_MessageValue;
5352
-
5353
- typedef union {
5354
- upb_Map* map;
5355
- upb_Message* msg;
5356
- upb_Array* array;
5357
- } upb_MutableMessageValue;
5358
-
5359
6014
  upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
5360
6015
 
5361
6016
  /** upb_Message
@@ -5418,98 +6073,6 @@ bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
5418
6073
  bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m,
5419
6074
  int maxdepth);
5420
6075
 
5421
- /** upb_Array *****************************************************************/
5422
-
5423
- /* Creates a new array on the given arena that holds elements of this type. */
5424
- upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
5425
-
5426
- /* Returns the size of the array. */
5427
- size_t upb_Array_Size(const upb_Array* arr);
5428
-
5429
- /* Returns the given element, which must be within the array's current size. */
5430
- upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
5431
-
5432
- /* Sets the given element, which must be within the array's current size. */
5433
- void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
5434
-
5435
- /* Appends an element to the array. Returns false on allocation failure. */
5436
- bool upb_Array_Append(upb_Array* array, upb_MessageValue val, upb_Arena* arena);
5437
-
5438
- /* Moves elements within the array using memmove(). Like memmove(), the source
5439
- * and destination elements may be overlapping. */
5440
- void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
5441
- size_t count);
5442
-
5443
- /* Inserts one or more empty elements into the array. Existing elements are
5444
- * shifted right. The new elements have undefined state and must be set with
5445
- * `upb_Array_Set()`.
5446
- * REQUIRES: `i <= upb_Array_Size(arr)` */
5447
- bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
5448
- upb_Arena* arena);
5449
-
5450
- /* Deletes one or more elements from the array. Existing elements are shifted
5451
- * left.
5452
- * REQUIRES: `i + count <= upb_Array_Size(arr)` */
5453
- void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
5454
-
5455
- /* Changes the size of a vector. New elements are initialized to empty/0.
5456
- * Returns false on allocation failure. */
5457
- bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
5458
-
5459
- /** upb_Map *******************************************************************/
5460
-
5461
- /* Creates a new map on the given arena with the given key/value size. */
5462
- upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, upb_CType value_type);
5463
-
5464
- /* Returns the number of entries in the map. */
5465
- size_t upb_Map_Size(const upb_Map* map);
5466
-
5467
- /* Stores a value for the given key into |*val| (or the zero value if the key is
5468
- * not present). Returns whether the key was present. The |val| pointer may be
5469
- * NULL, in which case the function tests whether the given key is present. */
5470
- bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
5471
- upb_MessageValue* val);
5472
-
5473
- /* Removes all entries in the map. */
5474
- void upb_Map_Clear(upb_Map* map);
5475
-
5476
- /* Sets the given key to the given value. Returns true if this was a new key in
5477
- * the map, or false if an existing key was replaced. */
5478
- bool upb_Map_Set(upb_Map* map, upb_MessageValue key, upb_MessageValue val,
5479
- upb_Arena* arena);
5480
-
5481
- /* Deletes this key from the table. Returns true if the key was present. */
5482
- bool upb_Map_Delete(upb_Map* map, upb_MessageValue key);
5483
-
5484
- /* Map iteration:
5485
- *
5486
- * size_t iter = kUpb_Map_Begin;
5487
- * while (upb_MapIterator_Next(map, &iter)) {
5488
- * upb_MessageValue key = upb_MapIterator_Key(map, iter);
5489
- * upb_MessageValue val = upb_MapIterator_Value(map, iter);
5490
- *
5491
- * // If mutating is desired.
5492
- * upb_MapIterator_SetValue(map, iter, value2);
5493
- * }
5494
- */
5495
-
5496
- /* Advances to the next entry. Returns false if no more entries are present. */
5497
- bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
5498
-
5499
- /* Returns true if the iterator still points to a valid entry, or false if the
5500
- * iterator is past the last element. It is an error to call this function with
5501
- * kUpb_Map_Begin (you must call next() at least once first). */
5502
- bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
5503
-
5504
- /* Returns the key and value for this entry of the map. */
5505
- upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
5506
- upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
5507
-
5508
- /* Sets the value for this entry. The iterator must not be done, and the
5509
- * iterator must not have been initialized const. */
5510
- void upb_MapIterator_SetValue(upb_Map* map, size_t iter,
5511
- upb_MessageValue value);
5512
-
5513
6076
  #ifdef __cplusplus
5514
6077
  } /* extern "C" */
5515
6078
  #endif
@@ -5517,27 +6080,6 @@ void upb_MapIterator_SetValue(upb_Map* map, size_t iter,
5517
6080
 
5518
6081
  #endif /* UPB_REFLECTION_H_ */
5519
6082
 
5520
- /** upb/json_decode.h ************************************************************/
5521
- #ifndef UPB_JSONDECODE_H_
5522
- #define UPB_JSONDECODE_H_
5523
-
5524
-
5525
- #ifdef __cplusplus
5526
- extern "C" {
5527
- #endif
5528
-
5529
- enum { upb_JsonDecode_IgnoreUnknown = 1 };
5530
-
5531
- bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
5532
- const upb_MessageDef* m, const upb_DefPool* symtab,
5533
- int options, upb_Arena* arena, upb_Status* status);
5534
-
5535
- #ifdef __cplusplus
5536
- } /* extern "C" */
5537
- #endif
5538
-
5539
- #endif /* UPB_JSONDECODE_H_ */
5540
-
5541
6083
  /** upb/json_encode.h ************************************************************/
5542
6084
  #ifndef UPB_JSONENCODE_H_
5543
6085
  #define UPB_JSONENCODE_H_
@@ -5574,6 +6116,192 @@ size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
5574
6116
 
5575
6117
  #endif /* UPB_JSONENCODE_H_ */
5576
6118
 
6119
+ /** upb/internal/vsnprintf_compat.h ************************************************************/
6120
+ #ifndef UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6121
+ #define UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6122
+
6123
+ #include <stdio.h>
6124
+
6125
+ // Must be last.
6126
+
6127
+ UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
6128
+ va_list ap) {
6129
+ #if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
6130
+ // The msvc runtime has a non-conforming vsnprintf() that requires the
6131
+ // following compatibility code to become conformant.
6132
+ int n = -1;
6133
+ if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
6134
+ if (n == -1) n = _vscprintf(fmt, ap);
6135
+ return n;
6136
+ #else
6137
+ return vsnprintf(buf, size, fmt, ap);
6138
+ #endif
6139
+ }
6140
+
6141
+
6142
+ #endif // UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6143
+
6144
+ /** upb/mini_table.h ************************************************************/
6145
+ #ifndef UPB_MINI_TABLE_H_
6146
+ #define UPB_MINI_TABLE_H_
6147
+
6148
+
6149
+ // Must be last.
6150
+
6151
+ #ifdef __cplusplus
6152
+ extern "C" {
6153
+ #endif
6154
+
6155
+ const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber(
6156
+ const upb_MiniTable* table, uint32_t number);
6157
+
6158
+ UPB_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
6159
+ const upb_MiniTable* mini_table, const upb_MiniTable_Field* field) {
6160
+ return mini_table->subs[field->submsg_index].submsg;
6161
+ }
6162
+
6163
+ UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum* e,
6164
+ int32_t val) {
6165
+ uint32_t uval = (uint32_t)val;
6166
+ if (uval < 64) return e->mask & (1ULL << uval);
6167
+ // OPT: binary search long lists?
6168
+ int n = e->value_count;
6169
+ for (int i = 0; i < n; i++) {
6170
+ if (e->values[i] == val) return true;
6171
+ }
6172
+ return false;
6173
+ }
6174
+
6175
+ /** upb_MtDataEncoder *********************************************************/
6176
+
6177
+ // Functions to encode a string in a format that can be loaded by
6178
+ // upb_MiniTable_Build().
6179
+
6180
+ typedef enum {
6181
+ kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
6182
+ kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
6183
+ kUpb_MessageModifier_IsExtendable = 1 << 2,
6184
+ } kUpb_MessageModifier;
6185
+
6186
+ typedef enum {
6187
+ kUpb_FieldModifier_IsRepeated = 1 << 0,
6188
+ kUpb_FieldModifier_IsPacked = 1 << 1,
6189
+ kUpb_FieldModifier_IsClosedEnum = 1 << 2,
6190
+ kUpb_FieldModifier_IsProto3Singular = 1 << 3,
6191
+ kUpb_FieldModifier_IsRequired = 1 << 4,
6192
+ } kUpb_FieldModifier;
6193
+
6194
+ typedef struct {
6195
+ char* end; // Limit of the buffer passed as a parameter.
6196
+ // Aliased to internal-only members in .cc.
6197
+ char internal[32];
6198
+ } upb_MtDataEncoder;
6199
+
6200
+ // If the input buffer has at least this many bytes available, the encoder call
6201
+ // is guaranteed to succeed (as long as field number order is maintained).
6202
+ #define kUpb_MtDataEncoder_MinSize 16
6203
+
6204
+ // Encodes field/oneof information for a given message. The sequence of calls
6205
+ // should look like:
6206
+ //
6207
+ // upb_MtDataEncoder e;
6208
+ // char buf[256];
6209
+ // char* ptr = buf;
6210
+ // e.end = ptr + sizeof(buf);
6211
+ // ptr = upb_MtDataEncoder_StartMessage(&e, ptr);
6212
+ // // Fields *must* be in field number order.
6213
+ // ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6214
+ // ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6215
+ // ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6216
+ //
6217
+ // // If oneofs are present. Oneofs must be encoded after regular fields.
6218
+ // ptr = upb_MiniTable_StartOneof(&e, ptr)
6219
+ // ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6220
+ // ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6221
+ //
6222
+ // ptr = upb_MiniTable_StartOneof(&e, ptr);
6223
+ // ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6224
+ // ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6225
+ //
6226
+ // Oneofs must be encoded after all regular fields.
6227
+ char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
6228
+ uint64_t msg_mod);
6229
+ char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
6230
+ upb_FieldType type, uint32_t field_num,
6231
+ uint64_t field_mod);
6232
+ char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
6233
+ char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
6234
+ uint32_t field_num);
6235
+
6236
+ // Encodes the set of values for a given enum. The values must be given in
6237
+ // order (after casting to uint32_t), and repeats are not allowed.
6238
+ void upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e);
6239
+ char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
6240
+ uint32_t val);
6241
+ char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr);
6242
+
6243
+ /** upb_MiniTable *************************************************************/
6244
+
6245
+ typedef enum {
6246
+ kUpb_MiniTablePlatform_32Bit,
6247
+ kUpb_MiniTablePlatform_64Bit,
6248
+ kUpb_MiniTablePlatform_Native =
6249
+ UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
6250
+ } upb_MiniTablePlatform;
6251
+
6252
+ // Builds a mini table from the data encoded in the buffer [data, len]. If any
6253
+ // errors occur, returns NULL and sets a status message. In the success case,
6254
+ // the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
6255
+ // fields to link the table to the appropriate sub-tables.
6256
+ upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
6257
+ upb_MiniTablePlatform platform,
6258
+ upb_Arena* arena, upb_Status* status);
6259
+ void upb_MiniTable_SetSubMessage(upb_MiniTable* table,
6260
+ upb_MiniTable_Field* field,
6261
+ const upb_MiniTable* sub);
6262
+ void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field,
6263
+ const upb_MiniTable_Enum* sub);
6264
+
6265
+ bool upb_MiniTable_BuildExtension(const char* data, size_t len,
6266
+ upb_MiniTable_Extension* ext,
6267
+ upb_MiniTable_Sub sub, upb_Status* status);
6268
+
6269
+ // Special-case functions for MessageSet layout and map entries.
6270
+ upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform,
6271
+ upb_Arena* arena);
6272
+ upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
6273
+ upb_FieldType value_type,
6274
+ bool value_is_proto3_enum,
6275
+ upb_MiniTablePlatform platform,
6276
+ upb_Arena* arena);
6277
+
6278
+ upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len,
6279
+ upb_Arena* arena,
6280
+ upb_Status* status);
6281
+
6282
+ // Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
6283
+ // it can be reused from call to call, avoiding repeated realloc()/free().
6284
+ //
6285
+ // The caller owns `*buf` both before and after the call, and must free() it
6286
+ // when it is no longer in use. The function will realloc() `*buf` as
6287
+ // necessary, updating `*size` accordingly.
6288
+ upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
6289
+ upb_MiniTablePlatform platform,
6290
+ upb_Arena* arena, void** buf,
6291
+ size_t* buf_size, upb_Status* status);
6292
+
6293
+ // For testing only.
6294
+ char upb_ToBase92(int8_t ch);
6295
+ char upb_FromBase92(uint8_t ch);
6296
+ bool upb_IsTypePackable(upb_FieldType type);
6297
+
6298
+ #ifdef __cplusplus
6299
+ } /* extern "C" */
6300
+ #endif
6301
+
6302
+
6303
+ #endif /* UPB_MINI_TABLE_H_ */
6304
+
5577
6305
  /** upb/port_undef.inc ************************************************************/
5578
6306
  /* See port_def.inc. This should #undef all macros #defined there. */
5579
6307
 
@@ -5587,6 +6315,7 @@ size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
5587
6315
  #undef UPB_ALIGN_DOWN
5588
6316
  #undef UPB_ALIGN_MALLOC
5589
6317
  #undef UPB_ALIGN_OF
6318
+ #undef UPB_MALLOC_ALIGN
5590
6319
  #undef UPB_LIKELY
5591
6320
  #undef UPB_UNLIKELY
5592
6321
  #undef UPB_FORCEINLINE