Bump upb version and refactor python compatibility.
This pulls in updates to system_python, which allows for better handling of our non-hermetic setup. Specifically, our python tests are marked incompatible on systems without a python installation. This will cause them to get skipped by wildcard expansions (which is why we add 1 explicit target to the kokoro builds).
PiperOrigin-RevId: 492286518
diff --git a/WORKSPACE b/WORKSPACE
index dbbefb7..b10e0d0 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -55,17 +55,6 @@
# For `cc_proto_blacklist_test` and `build_test`.
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
-load("@rules_python//python:pip.bzl", "pip_parse")
-
-pip_parse(
- name="pip_deps",
- requirements = "//python:requirements.txt"
-)
-
-load("@pip_deps//:requirements.bzl", "install_deps")
-
-install_deps()
-
bazel_skylib_workspace()
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
@@ -82,12 +71,27 @@
upb_deps()
load("@upb//bazel:system_python.bzl", "system_python")
-system_python(name = "local_config_python")
+system_python(
+ name = "system_python",
+ minimum_python_version = "3.7",
+)
+
+load("@system_python//:pip.bzl", "pip_parse")
+pip_parse(
+ name="pip_deps",
+ requirements = "@upb//python:requirements.txt",
+ requirements_overrides = {
+ "3.11": "@upb//python:requirements_311.txt",
+ },
+)
+
+load("@pip_deps//:requirements.bzl", "install_deps")
+install_deps()
load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps")
utf8_range_deps()
bind(
name = "python_headers",
- actual = "@local_config_python//:python_headers",
+ actual = "@system_python//:python_headers",
)
diff --git a/kokoro/linux/python310/common.cfg b/kokoro/linux/python310/common.cfg
index 7e4a798..a6fd200 100644
--- a/kokoro/linux/python310/common.cfg
+++ b/kokoro/linux/python310/common.cfg
@@ -11,7 +11,7 @@
env_vars {
key: "BAZEL_TARGETS"
- value: "//python/... @upb//python/..."
+ value: "//python/... @upb//python/... //python:python_version"
}
action {
diff --git a/kokoro/linux/python310_cpp/common.cfg b/kokoro/linux/python310_cpp/common.cfg
index 5b87fd6..d186163 100644
--- a/kokoro/linux/python310_cpp/common.cfg
+++ b/kokoro/linux/python310_cpp/common.cfg
@@ -12,7 +12,7 @@
env_vars {
key: "BAZEL_TARGETS"
# Note: upb tests don't work since the C++ extension takes precedence here.
- value: "//python/..."
+ value: "//python/... //python:python_version"
}
env_vars {
diff --git a/kokoro/linux/python37/common.cfg b/kokoro/linux/python37/common.cfg
index 3ae100c..101bce4 100644
--- a/kokoro/linux/python37/common.cfg
+++ b/kokoro/linux/python37/common.cfg
@@ -11,7 +11,7 @@
env_vars {
key: "BAZEL_TARGETS"
- value: "//python/... @upb//python/..."
+ value: "//python/... @upb//python/... //python:python_version"
}
action {
diff --git a/kokoro/linux/python37_cpp/common.cfg b/kokoro/linux/python37_cpp/common.cfg
index ebef928..d35be20 100644
--- a/kokoro/linux/python37_cpp/common.cfg
+++ b/kokoro/linux/python37_cpp/common.cfg
@@ -12,7 +12,7 @@
env_vars {
key: "BAZEL_TARGETS"
# Note: upb tests don't work since the C++ extension takes precedence here.
- value: "//python/..."
+ value: "//python/... //python:python_version"
}
env_vars {
diff --git a/kokoro/linux/python38/common.cfg b/kokoro/linux/python38/common.cfg
index 7d9e7aa..ee15892 100644
--- a/kokoro/linux/python38/common.cfg
+++ b/kokoro/linux/python38/common.cfg
@@ -11,7 +11,7 @@
env_vars {
key: "BAZEL_TARGETS"
- value: "//python/... @upb//python/..."
+ value: "//python/... @upb//python/... //python:python_version"
}
action {
diff --git a/kokoro/linux/python38_cpp/common.cfg b/kokoro/linux/python38_cpp/common.cfg
index decd466..f641b8c 100644
--- a/kokoro/linux/python38_cpp/common.cfg
+++ b/kokoro/linux/python38_cpp/common.cfg
@@ -12,7 +12,7 @@
env_vars {
key: "BAZEL_TARGETS"
# Note: upb tests don't work since the C++ extension takes precedence here.
- value: "//python/..."
+ value: "//python/... //python:python_version"
}
env_vars {
diff --git a/kokoro/linux/python39/common.cfg b/kokoro/linux/python39/common.cfg
index 5133ab5..af53e38 100644
--- a/kokoro/linux/python39/common.cfg
+++ b/kokoro/linux/python39/common.cfg
@@ -11,7 +11,7 @@
env_vars {
key: "BAZEL_TARGETS"
- value: "//python/... @upb//python/..."
+ value: "//python/... @upb//python/... //python:python_version"
}
action {
diff --git a/kokoro/linux/python39_cpp/common.cfg b/kokoro/linux/python39_cpp/common.cfg
index 9797008..e039310 100644
--- a/kokoro/linux/python39_cpp/common.cfg
+++ b/kokoro/linux/python39_cpp/common.cfg
@@ -12,7 +12,7 @@
env_vars {
key: "BAZEL_TARGETS"
# Note: upb tests don't work since the C++ extension takes precedence here.
- value: "//python/..."
+ value: "//python/... //python:python_version"
}
env_vars {
diff --git a/kokoro/macos/python/build.sh b/kokoro/macos/python/build.sh
index de3db88..a3edcea 100755
--- a/kokoro/macos/python/build.sh
+++ b/kokoro/macos/python/build.sh
@@ -9,5 +9,6 @@
KOKORO_INSTALL_VENV=yes
source kokoro/macos/prepare_build_macos_rc
-bazel test //python/... @upb//python/... $(kokoro/common/bazel_flags.sh) \
+bazel test //python/... @upb//python/... //python:python_version \
+ $(kokoro/common/bazel_flags.sh) \
--macos_minimum_os=10.9
diff --git a/kokoro/macos/python_cpp/build.sh b/kokoro/macos/python_cpp/build.sh
index 8f94fcf..9e83c3f 100755
--- a/kokoro/macos/python_cpp/build.sh
+++ b/kokoro/macos/python_cpp/build.sh
@@ -9,5 +9,7 @@
KOKORO_INSTALL_VENV=yes
source kokoro/macos/prepare_build_macos_rc
-bazel test //python/... $(kokoro/common/bazel_flags.sh) \
- --macos_minimum_os=10.9 --define=use_fast_cpp_protos=true
+bazel test //python/... //python:python_version \
+ $(kokoro/common/bazel_flags.sh) \
+ --macos_minimum_os=10.9 \
+ --define=use_fast_cpp_protos=true
diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c
index eabee06..4be85ed 100644
--- a/php/ext/google/protobuf/php-upb.c
+++ b/php/ext/google/protobuf/php-upb.c
@@ -1610,72 +1610,6 @@
UPB_STRINGVIEW_INIT(descriptor, 7820)
};
-
-
-// Must be last.
-
-#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
-
-struct upb_ExtensionRegistry {
- upb_Arena* arena;
- upb_strtable exts; // Key is upb_MiniTable* concatenated with fieldnum.
-};
-
-static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
- memcpy(buf, &l, sizeof(l));
- memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
-}
-
-upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) {
- upb_ExtensionRegistry* r = upb_Arena_Malloc(arena, sizeof(*r));
- if (!r) return NULL;
- r->arena = arena;
- if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
- return r;
-}
-
-bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
- const upb_MiniTableExtension** e,
- size_t count) {
- char buf[EXTREG_KEY_SIZE];
- const upb_MiniTableExtension** start = e;
- const upb_MiniTableExtension** end = UPB_PTRADD(e, count);
- for (; e < end; e++) {
- const upb_MiniTableExtension* ext = *e;
- extreg_key(buf, ext->extendee, ext->field.number);
- upb_value v;
- if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
- goto failure;
- }
- if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
- upb_value_constptr(ext), r->arena)) {
- goto failure;
- }
- }
- return true;
-
-failure:
- // Back out the entries previously added.
- for (end = e, e = start; e < end; e++) {
- const upb_MiniTableExtension* ext = *e;
- extreg_key(buf, ext->extendee, ext->field.number);
- upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
- }
- return false;
-}
-
-const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
- const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num) {
- char buf[EXTREG_KEY_SIZE];
- upb_value v;
- extreg_key(buf, t, num);
- if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
- return upb_value_getconstptr(v);
- } else {
- return NULL;
- }
-}
-
/*
* upb_table Implementation
*
@@ -5001,12 +4935,6 @@
return upb_Arena_Malloc(a, size);
}
-static void* upb_Arena_doalloc(upb_alloc* alloc, void* ptr, size_t oldsize,
- size_t size) {
- upb_Arena* a = (upb_Arena*)alloc; /* upb_alloc is initial member. */
- return upb_Arena_Realloc(a, ptr, oldsize, size);
-}
-
/* Public Arena API ***********************************************************/
static upb_Arena* arena_initslow(void* mem, size_t n, upb_alloc* alloc) {
@@ -5022,7 +4950,6 @@
a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
n -= sizeof(*a);
- a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
@@ -5056,7 +4983,6 @@
a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
- a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
@@ -5206,19 +5132,6 @@
return sizes[f->descriptortype];
}
-void upb_MiniTable_ClearField(upb_Message* msg,
- const upb_MiniTableField* field) {
- char* mem = UPB_PTR_AT(msg, field->offset, char);
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (_upb_MiniTableField_InOneOf(field)) {
- uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
- }
- memset(mem, 0, _upb_MiniTableField_Size(field));
-}
-
void* upb_MiniTable_ResizeArray(upb_Message* msg,
const upb_MiniTableField* field, size_t len,
upb_Arena* arena) {
@@ -5326,6 +5239,8 @@
if (result.status != kUpb_FindUnknown_Ok) {
return kUpb_GetExtension_NotPresent;
}
+ size_t len;
+ size_t ofs = result.ptr - upb_Message_GetUnknown(msg, &len);
// Decode and promote from unknown.
const upb_MiniTable* extension_table = ext_table->sub.submsg;
upb_UnknownToMessageRet parse_result = upb_MiniTable_ParseUnknownMessage(
@@ -5350,7 +5265,8 @@
}
memcpy(&ext->data, &extension_msg, sizeof(extension_msg));
*extension = ext;
- upb_Message_DeleteUnknown(msg, result.ptr, result.len);
+ const char* delete_ptr = upb_Message_GetUnknown(msg, &len) + ofs;
+ upb_Message_DeleteUnknown(msg, delete_ptr, result.len);
return kUpb_GetExtension_Ok;
}
@@ -5853,11 +5769,13 @@
UPB_PRINTF(2, 3)
UPB_NORETURN static void upb_MtDecoder_ErrorFormat(upb_MtDecoder* d,
const char* fmt, ...) {
- va_list argp;
- upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
- va_start(argp, fmt);
- upb_Status_VAppendErrorFormat(d->status, fmt, argp);
- va_end(argp);
+ if (d->status) {
+ va_list argp;
+ upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
+ va_start(argp, fmt);
+ upb_Status_VAppendErrorFormat(d->status, fmt, argp);
+ va_end(argp);
+ }
UPB_LONGJMP(d->err, 1);
}
@@ -6428,40 +6346,6 @@
d->table->size = UPB_ALIGN_UP(d->table->size, 8);
}
-static void upb_MiniTable_BuildMapEntry(upb_MtDecoder* d, char key_type,
- char val_type) {
- upb_MiniTableField* fields = upb_Arena_Malloc(d->arena, sizeof(*fields) * 2);
- if (!fields) {
- upb_MtDecoder_ErrorFormat(d, "OOM while building map mini table field");
- UPB_UNREACHABLE();
- }
-
- size_t field_size =
- upb_MtDecoder_SizeOfRep(kUpb_FieldRep_StringView, d->platform);
-
- uint32_t sub_count = 0;
- fields[0].number = 1;
- fields[1].number = 2;
- upb_MiniTable_SetField(d, key_type, &fields[0], 0, &sub_count);
- upb_MiniTable_SetField(d, val_type, &fields[1], 0, &sub_count);
- upb_MtDecoder_AllocateSubs(d, sub_count);
-
- // Map entries have a pre-determined layout, regardless of types.
- fields[0].presence = 0;
- fields[1].presence = 0;
- fields[0].offset = 0;
- fields[1].offset = field_size;
-
- upb_MiniTable* ret = d->table;
- ret->size = UPB_ALIGN_UP(2 * field_size, 8);
- ret->field_count = 2;
- ret->ext = kUpb_ExtMode_NonExtendable | kUpb_ExtMode_IsMapEntry;
- ret->dense_below = 2;
- ret->table_mask = -1;
- ret->required_count = 0;
- ret->fields = fields;
-}
-
static void upb_MtDecoder_ParseMap(upb_MtDecoder* d, const char* data,
size_t len) {
if (len < 2) {
@@ -6488,7 +6372,18 @@
upb_MtDecoder_ErrorFormat(d, "Invalid map key field type: %d", key_type);
UPB_UNREACHABLE();
}
- upb_MiniTable_BuildMapEntry(d, data[0], data[1]);
+
+ upb_MtDecoder_ParseMessage(d, data, len);
+ upb_MtDecoder_AssignHasbits(d->table);
+
+ // Map entries have a pre-determined layout, regardless of types.
+ d->fields[0].offset = offsetof(upb_MapEntryData, k);
+ d->fields[1].offset = offsetof(upb_MapEntryData, v);
+ d->table->size = UPB_ALIGN_UP(sizeof(upb_MapEntryData), 8);
+
+ // Map entries have a special bit set to signal it's a map entry, used in
+ // upb_MiniTable_SetSubMessage() below.
+ d->table->ext |= kUpb_ExtMode_IsMapEntry;
}
static void upb_MtDecoder_ParseMessageSet(upb_MtDecoder* d, const char* data,
@@ -6587,7 +6482,7 @@
return d->enum_table;
}
-static void upb_MiniTable_BuildEnumValue(upb_MtDecoder* d, uint32_t val) {
+static void upb_MiniTableEnum_BuildValue(upb_MtDecoder* d, uint32_t val) {
upb_MiniTableEnum* table = d->enum_table;
d->enum_value_count++;
if (table->value_count || (val > 512 && d->enum_value_count < val / 32)) {
@@ -6606,7 +6501,7 @@
}
}
-upb_MiniTableEnum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
upb_Arena* arena,
upb_Status* status) {
upb_MtDecoder decoder = {
@@ -6648,7 +6543,7 @@
if (ch <= kUpb_EncodedValue_MaxEnumMask) {
uint32_t mask = _upb_FromBase92(ch);
for (int i = 0; i < 5; i++, base++, mask >>= 1) {
- if (mask & 1) upb_MiniTable_BuildEnumValue(&decoder, base);
+ if (mask & 1) upb_MiniTableEnum_BuildValue(&decoder, base);
}
} else if (kUpb_EncodedValue_MinSkip <= ch &&
ch <= kUpb_EncodedValue_MaxSkip) {
@@ -6658,7 +6553,7 @@
kUpb_EncodedValue_MaxSkip, &skip);
base += skip;
} else {
- upb_Status_SetErrorFormat(status, "Unexpected character: %c", ch);
+ upb_MtDecoder_ErrorFormat(&decoder, "Unexpected character: %c", ch);
return NULL;
}
}
@@ -6666,7 +6561,7 @@
return decoder.enum_table;
}
-const char* _upb_MiniTable_BuildExtension(const char* data, size_t len,
+const char* _upb_MiniTableExtension_Build(const char* data, size_t len,
upb_MiniTableExtension* ext,
const upb_MiniTable* extendee,
upb_MiniTableSub sub,
@@ -6716,9 +6611,9 @@
return ret;
}
-upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
- upb_MiniTablePlatform platform,
- upb_Arena* arena, upb_Status* status) {
+upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status) {
void* buf = NULL;
size_t size = 0;
upb_MiniTable* ret = upb_MiniTable_BuildWithBuf(data, len, platform, arena,
@@ -6838,7 +6733,7 @@
char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
upb_FieldType key_type,
- upb_FieldType value_type,
+ upb_FieldType value_type, uint64_t key_mod,
uint64_t value_mod) {
upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
in->state.msg_state.msg_modifiers = 0;
@@ -6848,7 +6743,7 @@
ptr = upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_MapV1);
if (!ptr) return NULL;
- ptr = upb_MtDataEncoder_PutField(e, ptr, key_type, 1, 0);
+ ptr = upb_MtDataEncoder_PutField(e, ptr, key_type, 1, key_mod);
if (!ptr) return NULL;
return upb_MtDataEncoder_PutField(e, ptr, value_type, 2, value_mod);
@@ -7017,6 +6912,72 @@
return upb_MtDataEncoder_FlushDenseEnumMask(e, ptr);
}
+
+
+// Must be last.
+
+#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
+
+struct upb_ExtensionRegistry {
+ upb_Arena* arena;
+ upb_strtable exts; // Key is upb_MiniTable* concatenated with fieldnum.
+};
+
+static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
+ memcpy(buf, &l, sizeof(l));
+ memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
+}
+
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) {
+ upb_ExtensionRegistry* r = upb_Arena_Malloc(arena, sizeof(*r));
+ if (!r) return NULL;
+ r->arena = arena;
+ if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
+ return r;
+}
+
+bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
+ const upb_MiniTableExtension** e,
+ size_t count) {
+ char buf[EXTREG_KEY_SIZE];
+ const upb_MiniTableExtension** start = e;
+ const upb_MiniTableExtension** end = UPB_PTRADD(e, count);
+ for (; e < end; e++) {
+ const upb_MiniTableExtension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_value v;
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ goto failure;
+ }
+ if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
+ upb_value_constptr(ext), r->arena)) {
+ goto failure;
+ }
+ }
+ return true;
+
+failure:
+ // Back out the entries previously added.
+ for (end = e, e = start; e < end; e++) {
+ const upb_MiniTableExtension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
+ }
+ return false;
+}
+
+const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
+ const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num) {
+ char buf[EXTREG_KEY_SIZE];
+ upb_value v;
+ extreg_key(buf, t, num);
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ return upb_value_getconstptr(v);
+ } else {
+ return NULL;
+ }
+}
+
#include <string.h>
@@ -7967,7 +7928,7 @@
upb_Status status;
upb_MiniTableEnum* layout =
- upb_MiniTable_BuildEnum(sv.data, sv.size, ctx->arena, &status);
+ upb_MiniTableEnum_Build(sv.data, sv.size, ctx->arena, &status);
if (!layout)
_upb_DefBuilder_Errf(ctx, "Error building enum MiniTable: %s", status.msg);
return layout;
@@ -9131,7 +9092,7 @@
} else if (_upb_FieldDef_IsClosedEnum(f)) {
sub.subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
}
- bool ok2 = upb_MiniTable_BuildExtension(desc.data, desc.size, mut_ext,
+ bool ok2 = upb_MiniTableExtension_Build(desc.data, desc.size, mut_ext,
upb_MessageDef_MiniTable(m), sub,
ctx->status);
if (!ok2) _upb_DefBuilder_Errf(ctx, "Could not build extension mini table");
@@ -9499,61 +9460,9 @@
// Must be last.
-static size_t get_field_size(const upb_MiniTableField* f) {
- static unsigned char sizes[] = {
- 0, /* 0 */
- 8, /* kUpb_FieldType_Double */
- 4, /* kUpb_FieldType_Float */
- 8, /* kUpb_FieldType_Int64 */
- 8, /* kUpb_FieldType_UInt64 */
- 4, /* kUpb_FieldType_Int32 */
- 8, /* kUpb_FieldType_Fixed64 */
- 4, /* kUpb_FieldType_Fixed32 */
- 1, /* kUpb_FieldType_Bool */
- sizeof(upb_StringView), /* kUpb_FieldType_String */
- sizeof(void*), /* kUpb_FieldType_Group */
- sizeof(void*), /* kUpb_FieldType_Message */
- sizeof(upb_StringView), /* kUpb_FieldType_Bytes */
- 4, /* kUpb_FieldType_UInt32 */
- 4, /* kUpb_FieldType_Enum */
- 4, /* kUpb_FieldType_SFixed32 */
- 8, /* kUpb_FieldType_SFixed64 */
- 4, /* kUpb_FieldType_SInt32 */
- 8, /* kUpb_FieldType_SInt64 */
- };
- return upb_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype];
-}
-
-static bool in_oneof(const upb_MiniTableField* field) {
- return field->presence < 0;
-}
-
-static upb_MessageValue _upb_Message_Getraw(const upb_Message* msg,
- const upb_FieldDef* f) {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- const char* mem = UPB_PTR_AT(msg, field->offset, char);
- upb_MessageValue val = {0};
- memcpy(&val, mem, get_field_size(field));
- return val;
-}
-
bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f) {
- assert(upb_FieldDef_HasPresence(f));
- if (upb_FieldDef_IsExtension(f)) {
- const upb_MiniTableExtension* ext = _upb_FieldDef_ExtensionMiniTable(f);
- return _upb_Message_Getext(msg, ext) != NULL;
- } else {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- if (in_oneof(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- } else if (field->presence > 0) {
- return _upb_hasbit_field(msg, field);
- } else {
- UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message ||
- field->descriptortype == kUpb_FieldType_Group);
- return _upb_Message_Getraw(msg, f).msg_val != NULL;
- }
- }
+ UPB_ASSERT(upb_FieldDef_HasPresence(f));
+ return _upb_MiniTable_HasField(msg, upb_FieldDef_MiniTable(f));
}
const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg,
@@ -9624,22 +9533,7 @@
}
void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f) {
- if (upb_FieldDef_IsExtension(f)) {
- _upb_Message_Clearext(msg, _upb_FieldDef_ExtensionMiniTable(f));
- } else {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- char* mem = UPB_PTR_AT(msg, field->offset, char);
-
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (in_oneof(field)) {
- uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
- }
-
- memset(mem, 0, get_field_size(field));
- }
+ _upb_MiniTable_ClearField(msg, upb_FieldDef_MiniTable(f));
}
void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m) {
@@ -9651,31 +9545,28 @@
upb_MessageValue* out_val, size_t* iter) {
size_t i = *iter;
size_t n = upb_MessageDef_FieldCount(m);
- const upb_MessageValue zero = {0};
UPB_UNUSED(ext_pool);
- /* Iterate over normal fields, returning the first one that is set. */
+ // Iterate over normal fields, returning the first one that is set.
while (++i < n) {
const upb_FieldDef* f = upb_MessageDef_Field(m, i);
- upb_MessageValue val = _upb_Message_Getraw(msg, f);
+ const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
+ upb_MessageValue val = upb_Message_Get(msg, f);
- /* Skip field if unset or empty. */
- if (upb_FieldDef_HasPresence(f)) {
+ // Skip field if unset or empty.
+ if (upb_MiniTableField_HasPresence(field)) {
if (!upb_Message_Has(msg, f)) continue;
} else {
- upb_MessageValue test = val;
- if (upb_FieldDef_IsString(f) && !upb_FieldDef_IsRepeated(f)) {
- /* Clear string pointer, only size matters (ptr could be non-NULL). */
- test.str_val.data = NULL;
- }
- /* Continue if NULL or 0. */
- if (memcmp(&test, &zero, sizeof(test)) == 0) continue;
-
- /* Continue on empty array or map. */
- if (upb_FieldDef_IsMap(f)) {
- if (upb_Map_Size(test.map_val) == 0) continue;
- } else if (upb_FieldDef_IsRepeated(f)) {
- if (upb_Array_Size(test.array_val) == 0) continue;
+ switch (upb_FieldMode_Get(field)) {
+ case kUpb_FieldMode_Map:
+ if (!val.map_val || upb_Map_Size(val.map_val) == 0) continue;
+ break;
+ case kUpb_FieldMode_Array:
+ if (!val.array_val || upb_Array_Size(val.array_val) == 0) continue;
+ break;
+ case kUpb_FieldMode_Scalar:
+ if (!_upb_MiniTable_ValueIsNonZero(&val, field)) continue;
+ break;
}
}
@@ -9686,7 +9577,7 @@
}
if (ext_pool) {
- /* Return any extensions that are set. */
+ // Return any extensions that are set.
size_t count;
const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count);
if (i - n < count) {
@@ -10070,6 +9961,7 @@
desc.data, desc.size, kUpb_MiniTablePlatform_Native, ctx->arena,
scratch_data, scratch_size, ctx->status);
if (!ret) _upb_DefBuilder_FailJmp(ctx);
+
return ret;
}
@@ -10091,6 +9983,8 @@
UPB_ASSERT(layout_index < m->layout->field_count);
const upb_MiniTableField* mt_f = &m->layout->fields[layout_index];
UPB_ASSERT(upb_FieldDef_Type(f) == upb_MiniTableField_Type(mt_f));
+ UPB_ASSERT(upb_FieldDef_HasPresence(f) ==
+ upb_MiniTableField_HasPresence(mt_f));
}
#endif
@@ -10208,15 +10102,9 @@
UPB_ASSERT(_upb_FieldDef_LayoutIndex(key_field) == 0);
UPB_ASSERT(_upb_FieldDef_LayoutIndex(val_field) == 1);
- const upb_FieldType key_type = upb_FieldDef_Type(key_field);
- const upb_FieldType val_type = upb_FieldDef_Type(val_field);
-
- const uint64_t val_mod = _upb_FieldDef_IsClosedEnum(val_field)
- ? kUpb_FieldModifier_IsClosedEnum
- : 0;
-
- s->ptr =
- upb_MtDataEncoder_EncodeMap(&s->e, s->ptr, key_type, val_type, val_mod);
+ s->ptr = upb_MtDataEncoder_EncodeMap(
+ &s->e, s->ptr, upb_FieldDef_Type(key_field), upb_FieldDef_Type(val_field),
+ _upb_FieldDef_Modifiers(key_field), _upb_FieldDef_Modifiers(val_field));
return true;
}
@@ -11364,8 +11252,8 @@
const upb_MiniTableField* val_field = &entry->fields[1];
char key_size = kSizeInMap[key_field->descriptortype];
char val_size = kSizeInMap[val_field->descriptortype];
- UPB_ASSERT(key_field->offset == 0);
- UPB_ASSERT(val_field->offset == sizeof(upb_StringView));
+ UPB_ASSERT(key_field->offset == offsetof(upb_MapEntryData, k));
+ UPB_ASSERT(val_field->offset == offsetof(upb_MapEntryData, v));
upb_Map* ret = _upb_Map_New(&d->arena, key_size, val_size);
if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
return ret;
@@ -11392,15 +11280,16 @@
if (entry->fields[1].descriptortype == kUpb_FieldType_Message ||
entry->fields[1].descriptortype == kUpb_FieldType_Group) {
/* Create proactively to handle the case where it doesn't appear. */
- ent.v.val =
+ ent.data.v.val =
upb_value_ptr(_upb_Message_New(entry->subs[0].submsg, &d->arena));
}
const char* start = ptr;
- ptr = _upb_Decoder_DecodeSubMessage(d, ptr, &ent.k, subs, field, val->size);
+ ptr =
+ _upb_Decoder_DecodeSubMessage(d, ptr, &ent.data, subs, field, val->size);
// check if ent had any unknown fields
size_t size;
- upb_Message_GetUnknown(&ent.k, &size);
+ upb_Message_GetUnknown(&ent.data, &size);
if (size != 0) {
uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Delimited;
_upb_Decoder_AddUnknownVarints(d, msg, tag, (uint32_t)(ptr - start));
@@ -11408,7 +11297,8 @@
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
} else {
- if (_upb_Map_Insert(map, &ent.k, map->key_size, &ent.v, map->val_size,
+ if (_upb_Map_Insert(map, &ent.data.k, map->key_size, &ent.data.v,
+ map->val_size,
&d->arena) == kUpb_MapInsertStatus_OutOfMemory) {
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
@@ -13482,8 +13372,8 @@
const upb_MiniTableField* val_field = &layout->fields[1];
size_t pre_len = e->limit - e->ptr;
size_t size;
- encode_scalar(e, &ent->v, layout->subs, val_field);
- encode_scalar(e, &ent->k, layout->subs, key_field);
+ encode_scalar(e, &ent->data.v, layout->subs, val_field);
+ encode_scalar(e, &ent->data.k, layout->subs, key_field);
size = (e->limit - e->ptr) - pre_len;
encode_varint(e, size);
encode_tag(e, number, kUpb_WireType_Delimited);
@@ -13513,8 +13403,8 @@
upb_value val;
while (upb_strtable_next2(&map->table, &key, &val, &iter)) {
upb_MapEntry ent;
- _upb_map_fromkey(key, &ent.k, map->key_size);
- _upb_map_fromvalue(val, &ent.v, map->val_size);
+ _upb_map_fromkey(key, &ent.data.k, map->key_size);
+ _upb_map_fromvalue(val, &ent.data.v, map->val_size);
encode_mapentry(e, f->number, layout, &ent);
}
}
diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h
index 72a2ada..436e20d 100644
--- a/php/ext/google/protobuf/php-upb.h
+++ b/php/ext/google/protobuf/php-upb.h
@@ -554,11 +554,6 @@
typedef void upb_CleanupFunc(void* context);
typedef struct {
- /* We implement the allocator interface.
- * This must be the first member of upb_Arena!
- * TODO(haberman): remove once handlers are gone. */
- upb_alloc alloc;
-
char *ptr, *end;
} _upb_ArenaHead;
@@ -566,10 +561,11 @@
extern "C" {
#endif
-/* Creates an arena from the given initial block (if any -- n may be 0).
- * Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
- * is a fixed-size arena and cannot grow. */
+// Creates an arena from the given initial block (if any -- n may be 0).
+// Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
+// is a fixed-size arena and cannot grow.
upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
+
void upb_Arena_Free(upb_Arena* a);
bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func);
bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
@@ -577,8 +573,6 @@
size_t upb_Arena_SpaceAllocated(upb_Arena* arena);
uint32_t upb_Arena_DebugRefCount(upb_Arena* arena);
-UPB_INLINE upb_alloc* upb_Arena_Alloc(upb_Arena* a) { return (upb_alloc*)a; }
-
UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) {
_upb_ArenaHead* h = (_upb_ArenaHead*)a;
return (size_t)(h->end - h->ptr);
@@ -1409,6 +1403,216 @@
#endif /* UPB_COLLECTIONS_MAP_INTERNAL_H_ */
+#ifndef UPB_BASE_LOG2_H_
+#define UPB_BASE_LOG2_H_
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+UPB_INLINE int upb_Log2Ceiling(int x) {
+ if (x <= 1) return 0;
+#ifdef __GNUC__
+ return 32 - __builtin_clz(x - 1);
+#else
+ int lg2 = 0;
+ while (1 << lg2 < x) lg2++;
+ return lg2;
+#endif
+}
+
+UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_BASE_LOG2_H_ */
+
+// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
+
+#ifndef UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
+#define UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
+
+#include <stdlib.h>
+
+
+#ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
+#define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
+
+
+// Must be last.
+
+struct upb_Decoder;
+typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data);
+typedef struct {
+ uint64_t field_data;
+ _upb_FieldParser* field_parser;
+} _upb_FastTable_Entry;
+
+typedef enum {
+ kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
+ kUpb_ExtMode_Extendable = 1, // Normal extendable message.
+ kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
+ kUpb_ExtMode_IsMessageSet_ITEM =
+ 3, // MessageSet item (temporary only, see decode.c)
+
+ // During table building we steal a bit to indicate that the message is a map
+ // entry. *Only* used during table building!
+ kUpb_ExtMode_IsMapEntry = 4,
+} upb_ExtMode;
+
+// upb_MiniTable represents the memory layout of a given upb_MessageDef.
+// The members are public so generated code can initialize them,
+// but users MUST NOT directly read or write any of its members.
+struct upb_MiniTable {
+ const upb_MiniTableSub* subs;
+ const upb_MiniTableField* fields;
+
+ // Must be aligned to sizeof(void*). Doesn't include internal members like
+ // unknown fields, extension dict, pointer to msglayout, etc.
+ uint16_t size;
+
+ uint16_t field_count;
+ uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
+ uint8_t dense_below;
+ uint8_t table_mask;
+ uint8_t required_count; // Required fields have the lowest hasbits.
+
+ // To statically initialize the tables of variable length, we need a flexible
+ // array member, and we need to compile in gnu99 mode (constant initialization
+ // of flexible array members is a GNU extension, not in C99 unfortunately.
+ _upb_FastTable_Entry fasttable[];
+};
+
+// Map entries aren't actually stored for map fields, they are only used during
+// parsing. For parsing, it helps a lot if all map entry messages have the same
+// layout. The layout code in mini_table/decode.c will ensure that all map
+// entries have this layout.
+//
+// Note that users can and do create map entries directly, which will also use
+// this layout.
+typedef struct {
+ uint32_t hasbits;
+ union {
+ upb_StringView str; // For str/bytes.
+ upb_value val; // For all other types.
+ } k;
+ union {
+ upb_StringView str; // For str/bytes.
+ upb_value val; // For all other types.
+ } v;
+} upb_MapEntryData;
+
+typedef struct {
+ void* internal_data;
+ upb_MapEntryData data;
+} upb_MapEntry;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Computes a bitmask in which the |l->required_count| lowest bits are set,
+// except that we skip the lowest bit (because upb never uses hasbit 0).
+//
+// Sample output:
+// requiredmask(1) => 0b10 (0x2)
+// requiredmask(5) => 0b111110 (0x3e)
+UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
+ int n = l->required_count;
+ assert(0 < n && n <= 63);
+ return ((1ULL << n) - 1) << 1;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// _upb_mapsorter sorts maps and provides ordered iteration over the entries.
+// Since maps can be recursive (map values can be messages which contain other
+// maps), _upb_mapsorter can contain a stack of maps.
+
+typedef struct {
+ upb_tabent const** entries;
+ int size;
+ int cap;
+} _upb_mapsorter;
+
+typedef struct {
+ int start;
+ int pos;
+ int end;
+} _upb_sortedmap;
+
+UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
+ s->entries = NULL;
+ s->size = 0;
+ s->cap = 0;
+}
+
+UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
+ if (s->entries) free(s->entries);
+}
+
+UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
+ _upb_sortedmap* sorted, upb_MapEntry* ent) {
+ if (sorted->pos == sorted->end) return false;
+ const upb_tabent* tabent = s->entries[sorted->pos++];
+ upb_StringView key = upb_tabstrview(tabent->key);
+ _upb_map_fromkey(key, &ent->data.k, map->key_size);
+ upb_value val = {tabent->val.val};
+ _upb_map_fromvalue(val, &ent->data.v, map->val_size);
+ return true;
+}
+
+UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
+ _upb_sortedmap* sorted) {
+ s->size = sorted->start;
+}
+
+bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
+ const upb_Map* map, _upb_sortedmap* sorted);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
+
+/*
+** Our memory representation for parsing tables and messages themselves.
+** Functions in this file are used by generated code and possibly reflection.
+**
+** The definitions in this file are internal to upb.
+**/
+
+#ifndef UPB_MESSAGE_INTERNAL_H_
+#define UPB_MESSAGE_INTERNAL_H_
+
+#include <stdlib.h>
+#include <string.h>
+
+
+#ifndef UPB_MESSAGE_EXTENSION_INTERNAL_H_
+#define UPB_MESSAGE_EXTENSION_INTERNAL_H_
+
+
// Public APIs for message operations that do not require descriptors.
// These functions can be used even in build that does not want to depend on
// reflection or descriptors.
@@ -1449,130 +1653,6 @@
#endif /* UPB_MESSAGE_MESSAGE_H_ */
-#ifndef UPB_BASE_LOG2_H_
-#define UPB_BASE_LOG2_H_
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-UPB_INLINE int upb_Log2Ceiling(int x) {
- if (x <= 1) return 0;
-#ifdef __GNUC__
- return 32 - __builtin_clz(x - 1);
-#else
- int lg2 = 0;
- while (1 << lg2 < x) lg2++;
- return lg2;
-#endif
-}
-
-UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_BASE_LOG2_H_ */
-
-// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
-
-#ifndef UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
-#define UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
-
-
-/*
-** Our memory representation for parsing tables and messages themselves.
-** Functions in this file are used by generated code and possibly reflection.
-**
-** The definitions in this file are internal to upb.
-**/
-
-#ifndef UPB_MESSAGE_INTERNAL_H_
-#define UPB_MESSAGE_INTERNAL_H_
-
-#include <stdlib.h>
-#include <string.h>
-
-
-#ifndef UPB_EXTENSION_REGISTRY_H_
-#define UPB_EXTENSION_REGISTRY_H_
-
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Extension registry: a dynamic data structure that stores a map of:
- * (upb_MiniTable, number) -> extension info
- *
- * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
- * binary format.
- *
- * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
- * objects. Like all mini-table objects, it is suitable for reflection-less
- * builds that do not want to expose names into the binary.
- *
- * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
- * allocation and dynamic initialization:
- * * If reflection is being used, then upb_DefPool will construct an appropriate
- * upb_ExtensionRegistry automatically.
- * * For a mini-table only build, the user must manually construct the
- * upb_ExtensionRegistry and populate it with all of the extensions the user
- * cares about.
- * * A third alternative is to manually unpack relevant extensions after the
- * main parse is complete, similar to how Any works. This is perhaps the
- * nicest solution from the perspective of reducing dependencies, avoiding
- * dynamic memory allocation, and avoiding the need to parse uninteresting
- * extensions. The downsides are:
- * (1) parse errors are not caught during the main parse
- * (2) the CPU hit of parsing comes during access, which could cause an
- * undesirable stutter in application performance.
- *
- * Users cannot directly get or put into this map. Users can only add the
- * extensions from a generated module and pass the extension registry to the
- * binary decoder.
- *
- * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
- * reflection do not need to populate a upb_ExtensionRegistry directly.
- */
-
-typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
-
-// Creates a upb_ExtensionRegistry in the given arena.
-// The arena must outlive any use of the extreg.
-upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
-
-// Adds the given extension info for the array |e| of size |count| into the
-// registry. If there are any errors, the entire array is backed out.
-// The extensions must outlive the registry.
-// Possible errors include OOM or an extension number that already exists.
-// TODO: There is currently no way to determine the exact reason for failure.
-bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
- const upb_MiniTableExtension** e,
- size_t count);
-
-// Looks up the extension (if any) defined for message type |t| and field
-// number |num|. Returns the extension if found, otherwise NULL.
-const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
- const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_EXTENSION_REGISTRY_H_ */
-
-#ifndef UPB_MESSAGE_EXTENSION_INTERNAL_H_
-#define UPB_MESSAGE_EXTENSION_INTERNAL_H_
-
-
#ifndef UPB_MINI_TABLE_EXTENSION_INTERNAL_H_
#define UPB_MINI_TABLE_EXTENSION_INTERNAL_H_
@@ -1801,6 +1881,77 @@
#endif /* UPB_MESSAGE_EXTENSION_INTERNAL_H_ */
+#ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
+#define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
+
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Extension registry: a dynamic data structure that stores a map of:
+ * (upb_MiniTable, number) -> extension info
+ *
+ * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
+ * binary format.
+ *
+ * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
+ * objects. Like all mini-table objects, it is suitable for reflection-less
+ * builds that do not want to expose names into the binary.
+ *
+ * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
+ * allocation and dynamic initialization:
+ * * If reflection is being used, then upb_DefPool will construct an appropriate
+ * upb_ExtensionRegistry automatically.
+ * * For a mini-table only build, the user must manually construct the
+ * upb_ExtensionRegistry and populate it with all of the extensions the user
+ * cares about.
+ * * A third alternative is to manually unpack relevant extensions after the
+ * main parse is complete, similar to how Any works. This is perhaps the
+ * nicest solution from the perspective of reducing dependencies, avoiding
+ * dynamic memory allocation, and avoiding the need to parse uninteresting
+ * extensions. The downsides are:
+ * (1) parse errors are not caught during the main parse
+ * (2) the CPU hit of parsing comes during access, which could cause an
+ * undesirable stutter in application performance.
+ *
+ * Users cannot directly get or put into this map. Users can only add the
+ * extensions from a generated module and pass the extension registry to the
+ * binary decoder.
+ *
+ * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
+ * reflection do not need to populate a upb_ExtensionRegistry directly.
+ */
+
+typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
+
+// Creates a upb_ExtensionRegistry in the given arena.
+// The arena must outlive any use of the extreg.
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
+
+// Adds the given extension info for the array |e| of size |count| into the
+// registry. If there are any errors, the entire array is backed out.
+// The extensions must outlive the registry.
+// Possible errors include OOM or an extension number that already exists.
+// TODO: There is currently no way to determine the exact reason for failure.
+bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
+ const upb_MiniTableExtension** e,
+ size_t count);
+
+// Looks up the extension (if any) defined for message type |t| and field
+// number |num|. Returns the extension if found, otherwise NULL.
+const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
+ const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
+
#ifndef UPB_MINI_TABLE_FILE_INTERNAL_H_
#define UPB_MINI_TABLE_FILE_INTERNAL_H_
@@ -1819,79 +1970,6 @@
#endif /* UPB_MINI_TABLE_FILE_INTERNAL_H_ */
-#ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
-#define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
-
-
-// Must be last.
-
-struct upb_Decoder;
-typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
- upb_Message* msg, intptr_t table,
- uint64_t hasbits, uint64_t data);
-typedef struct {
- uint64_t field_data;
- _upb_FieldParser* field_parser;
-} _upb_FastTable_Entry;
-
-typedef enum {
- kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
- kUpb_ExtMode_Extendable = 1, // Normal extendable message.
- kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
- kUpb_ExtMode_IsMessageSet_ITEM =
- 3, // MessageSet item (temporary only, see decode.c)
-
- // During table building we steal a bit to indicate that the message is a map
- // entry. *Only* used during table building!
- kUpb_ExtMode_IsMapEntry = 4,
-} upb_ExtMode;
-
-// upb_MiniTable represents the memory layout of a given upb_MessageDef.
-// The members are public so generated code can initialize them,
-// but users MUST NOT directly read or write any of its members.
-struct upb_MiniTable {
- const upb_MiniTableSub* subs;
- const upb_MiniTableField* fields;
-
- // Must be aligned to sizeof(void*). Doesn't include internal members like
- // unknown fields, extension dict, pointer to msglayout, etc.
- uint16_t size;
-
- uint16_t field_count;
- uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
- uint8_t dense_below;
- uint8_t table_mask;
- uint8_t required_count; // Required fields have the lowest hasbits.
-
- // To statically initialize the tables of variable length, we need a flexible
- // array member, and we need to compile in gnu99 mode (constant initialization
- // of flexible array members is a GNU extension, not in C99 unfortunately.
- _upb_FastTable_Entry fasttable[];
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Computes a bitmask in which the |l->required_count| lowest bits are set,
-// except that we skip the lowest bit (because upb never uses hasbit 0).
-//
-// Sample output:
-// requiredmask(1) => 0b10 (0x2)
-// requiredmask(5) => 0b111110 (0x3e)
-UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
- int n = l->required_count;
- assert(0 < n && n <= 63);
- return ((1ULL << n) - 1) << 1;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
-
// Must be last.
#ifdef __cplusplus
@@ -1971,21 +2049,6 @@
bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
upb_Arena* arena);
-/* Map entries aren't actually stored, they are only used during parsing. For
- * parsing, it helps a lot if all map entry messages have the same layout.
- * The compiler and def.c must ensure that all map entries have this layout. */
-typedef struct {
- upb_Message_Internal internal;
- union {
- upb_StringView str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } k;
- union {
- upb_StringView str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } v;
-} upb_MapEntry;
-
#ifdef __cplusplus
} /* extern "C" */
#endif
@@ -1993,64 +2056,6 @@
#endif /* UPB_MESSAGE_INTERNAL_H_ */
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// _upb_mapsorter sorts maps and provides ordered iteration over the entries.
-// Since maps can be recursive (map values can be messages which contain other
-// maps), _upb_mapsorter can contain a stack of maps.
-
-typedef struct {
- upb_tabent const** entries;
- int size;
- int cap;
-} _upb_mapsorter;
-
-typedef struct {
- int start;
- int pos;
- int end;
-} _upb_sortedmap;
-
-UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
- s->entries = NULL;
- s->size = 0;
- s->cap = 0;
-}
-
-UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
- if (s->entries) free(s->entries);
-}
-
-UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
- _upb_sortedmap* sorted, upb_MapEntry* ent) {
- if (sorted->pos == sorted->end) return false;
- const upb_tabent* tabent = s->entries[sorted->pos++];
- upb_StringView key = upb_tabstrview(tabent->key);
- _upb_map_fromkey(key, &ent->k, map->key_size);
- upb_value val = {tabent->val.val};
- _upb_map_fromvalue(val, &ent->v, map->val_size);
- return true;
-}
-
-UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
- _upb_sortedmap* sorted) {
- s->size = sorted->start;
-}
-
-bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
- const upb_Map* map, _upb_sortedmap* sorted);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
-
#ifndef UPB_MINI_TABLE_ENUM_INTERNAL_H_
#define UPB_MINI_TABLE_ENUM_INTERNAL_H_
@@ -2252,6 +2257,15 @@
return field->mode & kUpb_LabelFlags_IsExtension;
}
+UPB_INLINE bool upb_MiniTableField_HasPresence(
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ return !upb_IsRepeatedOrMap(field);
+ } else {
+ return field->presence != 0;
+ }
+}
+
UPB_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
return mini_table->subs[field->submsg_index].submsg;
@@ -2301,8 +2315,8 @@
UPB_INLINE bool upb_MiniTable_HasField(const upb_Message* msg,
const upb_MiniTableField* field);
-UPB_INLINE bool _upb_MiniTable_DefaultIsNonZero(
- const void* default_val, const upb_MiniTableField* field) {
+UPB_INLINE bool _upb_MiniTable_ValueIsNonZero(const void* default_val,
+ const upb_MiniTableField* field) {
char zero[16] = {0};
switch (_upb_MiniTableField_GetRep(field)) {
case kUpb_FieldRep_1Byte:
@@ -2372,7 +2386,7 @@
const void* default_val, void* val) {
UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
if ((_upb_MiniTableField_InOneOf(field) ||
- _upb_MiniTable_DefaultIsNonZero(default_val, field)) &&
+ _upb_MiniTable_ValueIsNonZero(default_val, field)) &&
!upb_MiniTable_HasField(msg, field)) {
_upb_MiniTable_CopyFieldData(val, default_val, field);
return;
@@ -2434,19 +2448,71 @@
}
}
+UPB_INLINE bool _upb_MiniTable_HasExtensionField(
+ const upb_Message* msg, const upb_MiniTableExtension* ext) {
+ UPB_ASSERT(upb_MiniTableField_HasPresence(&ext->field));
+ return _upb_Message_Getext(msg, ext) != NULL;
+}
+
+UPB_INLINE bool _upb_MiniTable_HasNonExtensionField(
+ const upb_Message* msg, const upb_MiniTableField* field) {
+ UPB_ASSERT(upb_MiniTableField_HasPresence(field));
+ UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
+ if (_upb_MiniTableField_InOneOf(field)) {
+ return _upb_getoneofcase_field(msg, field) == field->number;
+ } else {
+ return _upb_hasbit_field(msg, field);
+ }
+}
+
+UPB_INLINE bool _upb_MiniTable_HasField(const upb_Message* msg,
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ return _upb_MiniTable_HasExtensionField(
+ msg, (const upb_MiniTableExtension*)field);
+ } else {
+ return _upb_MiniTable_HasNonExtensionField(msg, field);
+ }
+}
+
+UPB_INLINE void _upb_MiniTable_ClearExtensionField(
+ upb_Message* msg, const upb_MiniTableExtension* ext) {
+ _upb_Message_Clearext(msg, ext);
+}
+
+UPB_INLINE void _upb_MiniTable_ClearNonExtensionField(
+ upb_Message* msg, const upb_MiniTableField* field) {
+ if (field->presence > 0) {
+ _upb_clearhas_field(msg, field);
+ } else if (_upb_MiniTableField_InOneOf(field)) {
+ uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
+ if (*oneof_case != field->number) return;
+ *oneof_case = 0;
+ }
+ const char zeros[16] = {0};
+ _upb_MiniTable_CopyFieldData(_upb_MiniTableField_GetPtr(msg, field), zeros,
+ field);
+}
+
+UPB_INLINE void _upb_MiniTable_ClearField(upb_Message* msg,
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ _upb_Message_Clearext(msg, (const upb_MiniTableExtension*)field);
+ } else {
+ _upb_MiniTable_ClearNonExtensionField(msg, field);
+ }
+}
+
// EVERYTHING ABOVE THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
-void upb_MiniTable_ClearField(upb_Message* msg,
- const upb_MiniTableField* field);
+UPB_INLINE void upb_MiniTable_ClearField(upb_Message* msg,
+ const upb_MiniTableField* field) {
+ _upb_MiniTable_ClearNonExtensionField(msg, field);
+}
UPB_INLINE bool upb_MiniTable_HasField(const upb_Message* msg,
const upb_MiniTableField* field) {
- if (_upb_MiniTableField_InOneOf(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- }
-
- UPB_ASSERT(field->presence > 0);
- return _upb_hasbit_field(msg, field);
+ return _upb_MiniTable_HasNonExtensionField(msg, field);
}
UPB_INLINE bool upb_MiniTable_GetBool(const upb_Message* msg,
@@ -3196,15 +3262,18 @@
(void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* len) {
return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorSet_file(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* len) {
return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, 0, len);
@@ -3254,12 +3323,9 @@
(void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3268,12 +3334,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3282,54 +3349,73 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 40));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 40), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 48));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_dependency(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 48));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(8, 48), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 56));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_message_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 56));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 56), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 64));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_enum_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 64));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 64), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 72));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_service(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 72));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 72), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_extension(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 80), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
const google_protobuf_FileOptions* default_val = NULL;
@@ -3338,12 +3424,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 88), const upb_Message*) = NULL;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
const google_protobuf_SourceCodeInfo* default_val = NULL;
@@ -3352,24 +3439,37 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(32, 96));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 96), len);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(36, 104));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_public_dependency(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(36, 104), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_weak_dependency(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3378,12 +3478,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3392,6 +3493,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -3538,12 +3643,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3552,57 +3654,73 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 32));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_field(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 32));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(8, 32), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 40));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_nested_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 40));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 40), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 48));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_enum_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 48));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(16, 48), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 56));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_extension_range(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 56));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 56), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_extension(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 64), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
const google_protobuf_MessageOptions* default_val = NULL;
@@ -3611,30 +3729,46 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 72));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(28, 72));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 72), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 80));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_oneof_decl(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(32, 80));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(32, 80), len);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(36, 88));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_reserved_range(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 88), len);
}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_reserved_name(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -3779,12 +3913,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3793,12 +3924,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3807,12 +3939,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
const google_protobuf_ExtensionRangeOptions* default_val = NULL;
@@ -3821,6 +3954,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -3875,12 +4012,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3889,12 +4023,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3903,6 +4038,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -3946,15 +4085,18 @@
(void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) {
+ const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
+ size_t size;
+ google_protobuf_ExtensionRangeOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, 0, len);
@@ -4004,12 +4146,9 @@
(void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4018,12 +4157,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4032,12 +4172,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4046,12 +4187,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = 1;
@@ -4060,12 +4202,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 12, int32_t) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = 1;
@@ -4074,12 +4217,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4088,12 +4232,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4102,12 +4247,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 8);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 88), const upb_Message*) = NULL;
- _upb_clearhas(msg, 8);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
const google_protobuf_FieldOptions* default_val = NULL;
@@ -4116,12 +4262,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 9);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 16), int32_t) = 0;
- _upb_clearhas(msg, 9);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4130,12 +4277,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 10);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 10);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4144,12 +4292,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 11);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 20), bool) = 0;
- _upb_clearhas(msg, 11);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
bool default_val = false;
@@ -4158,6 +4307,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4236,12 +4389,9 @@
(void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 8, upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4250,12 +4400,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 24), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
const google_protobuf_OneofOptions* default_val = NULL;
@@ -4264,6 +4415,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4315,12 +4470,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4329,21 +4481,25 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_value(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 32), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
const google_protobuf_EnumOptions* default_val = NULL;
@@ -4352,21 +4508,34 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 40));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 40));
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(12, 40), len);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 48));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_reserved_range(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 48), len);
}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_reserved_name(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4451,12 +4620,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -4465,12 +4631,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -4479,6 +4646,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -4522,12 +4693,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4536,12 +4704,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4550,12 +4719,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 24), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
const google_protobuf_EnumValueOptions* default_val = NULL;
@@ -4564,6 +4734,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4618,12 +4792,9 @@
(void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4632,21 +4803,25 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_ServiceDescriptorProto_method(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 32), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
const google_protobuf_ServiceOptions* default_val = NULL;
@@ -4655,6 +4830,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4718,12 +4897,9 @@
(void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4732,12 +4908,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4746,12 +4923,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4760,12 +4938,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 56), const upb_Message*) = NULL;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
const google_protobuf_MethodOptions* default_val = NULL;
@@ -4774,12 +4953,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 1), bool) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
bool default_val = false;
@@ -4788,12 +4968,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(9, 2), bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
bool default_val = false;
@@ -4802,6 +4983,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4865,12 +5050,9 @@
(void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 24, upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4879,12 +5061,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4893,12 +5076,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
int32_t default_val = 1;
@@ -4907,12 +5091,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 8, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4921,12 +5106,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4935,12 +5121,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 9, bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4949,12 +5136,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 10, bool) = 0;
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4963,12 +5151,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 8);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 11, bool) = 0;
- _upb_clearhas(msg, 8);
+UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4977,12 +5166,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 9);
+UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 12, bool) = 0;
- _upb_clearhas(msg, 9);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4991,12 +5181,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 10);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 13, bool) = 0;
- _upb_clearhas(msg, 10);
+UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5005,12 +5196,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 11);
+UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 14, bool) = 0;
- _upb_clearhas(msg, 11);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5019,12 +5211,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 12);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 15, bool) = 0;
- _upb_clearhas(msg, 12);
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
bool default_val = true;
@@ -5033,12 +5226,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 13);
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 13);
+UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5047,12 +5241,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 14);
+UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 14);
+UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5061,12 +5256,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 15);
+UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 15);
+UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5075,12 +5271,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 16);
+UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 16);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5089,12 +5286,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 17);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 17);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5103,12 +5301,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 18);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 16, bool) = 0;
- _upb_clearhas(msg, 18);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5117,12 +5316,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 19);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(88, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 19);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5131,12 +5331,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 20);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(96, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 20);
+UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5145,15 +5346,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 184));
+UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 184));
+UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 184), len);
}
+UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
+ size_t size;
+ google_protobuf_FileOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -5263,12 +5471,9 @@
(void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5277,12 +5482,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 2, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5291,12 +5497,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 3, bool) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5305,12 +5512,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 4, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5319,15 +5527,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 8);
+UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
- _upb_array_detach(msg, 8);
+UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 8, len);
}
+UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
+ size_t size;
+ google_protobuf_MessageOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5389,12 +5604,9 @@
(void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
int32_t default_val = 0;
@@ -5403,12 +5615,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 8, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5417,12 +5630,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 9, bool) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5431,12 +5645,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 10, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5445,12 +5660,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 12, int32_t) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
int32_t default_val = 0;
@@ -5459,12 +5675,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 16, bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5473,12 +5690,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 17, bool) = 0;
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5487,15 +5705,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24));
+UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 24));
+UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len);
}
+UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
+ size_t size;
+ google_protobuf_FieldOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -5566,15 +5791,18 @@
(void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) {
+ const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
+ size_t size;
+ google_protobuf_OneofOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, 0, len);
@@ -5624,12 +5852,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
bool default_val = false;
@@ -5638,12 +5863,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) {
- *UPB_PTR_AT(msg, 2, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
bool default_val = false;
@@ -5652,15 +5878,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
+ size_t size;
+ google_protobuf_EnumOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5716,12 +5949,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
bool default_val = false;
@@ -5730,15 +5960,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
+ size_t size;
+ google_protobuf_EnumValueOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5791,12 +6028,9 @@
(void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
bool default_val = false;
@@ -5805,15 +6039,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
+ size_t size;
+ google_protobuf_ServiceOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5866,12 +6107,9 @@
(void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
bool default_val = false;
@@ -5880,12 +6118,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
int32_t default_val = 0;
@@ -5894,15 +6133,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 8);
+UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
- _upb_array_detach(msg, 8);
+UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 8, len);
}
+UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
+ size_t size;
+ google_protobuf_MethodOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5958,21 +6204,21 @@
(void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
-}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
+ size_t size;
+ google_protobuf_UninterpretedOption_name(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5981,12 +6227,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
uint64_t default_val = (uint64_t)0ull;
@@ -5995,12 +6242,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
int64_t default_val = (int64_t)0ll;
@@ -6009,12 +6257,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), double) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
double default_val = 0;
@@ -6023,12 +6272,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6037,12 +6287,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6051,6 +6302,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* len) {
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
@@ -6118,12 +6373,9 @@
(void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6132,12 +6384,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
bool default_val = false;
@@ -6146,6 +6399,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -6189,15 +6446,18 @@
(void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* len) {
return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_location(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* len) {
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, 0, len);
@@ -6247,24 +6507,33 @@
(void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 16));
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_path(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_path(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_span(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_span(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6273,12 +6542,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6287,12 +6557,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 56));
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 56), len);
}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_leading_detached_comments(msg, &size);
+ return size != 0;
+}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
@@ -6363,15 +6643,18 @@
(void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
+ size_t size;
+ google_protobuf_GeneratedCodeInfo_annotation(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, 0, len);
@@ -6421,18 +6704,21 @@
(void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 16));
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 16), len);
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ size_t size;
+ google_protobuf_GeneratedCodeInfo_Annotation_path(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6441,12 +6727,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 4), int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = (int32_t)0;
@@ -6455,12 +6742,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = (int32_t)0;
@@ -6469,12 +6757,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 12), int32_t) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = 0;
@@ -6483,6 +6772,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 16), len);
@@ -7777,9 +8070,8 @@
typedef enum {
kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
- // upb only.
+ kUpb_EncodedFieldModifier_IsRequired = 1 << 1,
kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
- kUpb_EncodedFieldModifier_IsRequired = 1 << 3,
} upb_EncodedFieldModifier;
enum {
@@ -7860,9 +8152,16 @@
// errors occur, returns NULL and sets a status message. In the success case,
// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
// fields to link the table to the appropriate sub-tables.
-upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
- upb_MiniTablePlatform platform,
- upb_Arena* arena, upb_Status* status);
+upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status);
+
+UPB_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
+ upb_Arena* arena,
+ upb_Status* status) {
+ return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
+ status);
+}
// Links a sub-message field to a MiniTable for that sub-message. If a
// sub-message field is not linked, it will be treated as an unknown field
@@ -7879,21 +8178,21 @@
void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTableField* field,
const upb_MiniTableEnum* sub);
-const char* _upb_MiniTable_BuildExtension(const char* data, size_t len,
+const char* _upb_MiniTableExtension_Build(const char* data, size_t len,
upb_MiniTableExtension* ext,
const upb_MiniTable* extendee,
upb_MiniTableSub sub,
upb_MiniTablePlatform platform,
upb_Status* status);
-UPB_INLINE const char* upb_MiniTable_BuildExtension(
+UPB_INLINE const char* upb_MiniTableExtension_Build(
const char* data, size_t len, upb_MiniTableExtension* ext,
const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
- return _upb_MiniTable_BuildExtension(data, len, ext, extendee, sub,
+ return _upb_MiniTableExtension_Build(data, len, ext, extendee, sub,
kUpb_MiniTablePlatform_Native, status);
}
-upb_MiniTableEnum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
upb_Arena* arena,
upb_Status* status);
@@ -7983,7 +8282,8 @@
// Encodes an entire mini descriptor for a map.
char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
upb_FieldType key_type,
- upb_FieldType value_type, uint64_t value_mod);
+ upb_FieldType value_type, uint64_t key_mod,
+ uint64_t value_mod);
// Encodes an entire mini descriptor for a message set.
char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr);
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index ab35c5e..3d65b5a 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -135,6 +135,6 @@
_github_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
- commit = "efb166b3b0b427052ac0b40d01b8dd078f6d3e3b",
- sha256 = "75f3589154114a6e7c521b61784530dcf9347fb8f1fb103f72db4cb373064a33",
+ commit = "b198dd0754c415fa2bc445b2f07121ac3761048b",
+ sha256 = "f400a6b425cfb334c360fc50192343139941aebeb451ed1d793b7cdba75a066c",
)
diff --git a/python/BUILD.bazel b/python/BUILD.bazel
index 56d8c8a..d40e76a 100644
--- a/python/BUILD.bazel
+++ b/python/BUILD.bazel
@@ -12,7 +12,7 @@
load("//:protobuf.bzl", "internal_py_proto_library")
load("//build_defs:cpp_opts.bzl", "COPTS")
load("//conformance:defs.bzl", "conformance_test")
-load(":internal.bzl", "internal_copy_files")
+load(":internal.bzl", "internal_copy_files", "internal_py_test")
py_library(
name = "protobuf_python",
@@ -256,149 +256,111 @@
],
)
-py_test(
+internal_py_test(
name = "descriptor_database_test",
srcs = ["google/protobuf/internal/descriptor_database_test.py"],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "descriptor_pool_test",
srcs = ["google/protobuf/internal/descriptor_pool_test.py"],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "descriptor_test",
srcs = ["google/protobuf/internal/descriptor_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "field_mask_test",
srcs = ["google/protobuf/internal/field_mask_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "generator_test",
srcs = ["google/protobuf/internal/generator_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "import_test",
srcs = ["google/protobuf/internal/import_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "json_format_test",
srcs = ["google/protobuf/internal/json_format_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "keywords_test",
srcs = ["google/protobuf/internal/keywords_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "message_factory_test",
srcs = ["google/protobuf/internal/message_factory_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "message_test",
srcs = ["google/protobuf/internal/message_test.py"],
data = glob(["testdata/golden_pickle_*"]) + [
"//src/google/protobuf:testdata",
],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "numpy_test",
srcs = ["google/protobuf/internal/numpy_test.py"],
- imports = ["."],
deps = [
- ":python_test_lib",
requirement("numpy"),
],
)
-py_test(
+internal_py_test(
name = "proto_builder_test",
srcs = ["google/protobuf/internal/proto_builder_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "reflection_test",
srcs = ["google/protobuf/internal/reflection_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "service_reflection_test",
srcs = ["google/protobuf/internal/service_reflection_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "symbol_database_test",
srcs = ["google/protobuf/internal/symbol_database_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "text_encoding_test",
srcs = ["google/protobuf/internal/text_encoding_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "text_format_test",
srcs = ["google/protobuf/internal/text_format_test.py"],
data = ["//src/google/protobuf:testdata"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "unknown_fields_test",
srcs = ["google/protobuf/internal/unknown_fields_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "well_known_types_test",
srcs = ["google/protobuf/internal/well_known_types_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
-py_test(
+internal_py_test(
name = "wire_format_test",
srcs = ["google/protobuf/internal/wire_format_test.py"],
- imports = ["."],
- deps = [":python_test_lib"],
)
cc_library(
@@ -410,7 +372,7 @@
],
)
-py_test(
+internal_py_test(
name = "python_version",
srcs = ["python_version.py"],
)
@@ -420,6 +382,7 @@
env = {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "python"},
failure_list = "//conformance:failure_list_python.txt",
target_compatible_with = select({
+ "@system_python//:none": ["@platforms//:incompatible"],
":use_fast_cpp_protos": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
@@ -433,6 +396,7 @@
env = {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "cpp"},
failure_list = "//conformance:failure_list_python.txt",
target_compatible_with = select({
+ "@system_python//:none": ["@platforms//:incompatible"],
":use_fast_cpp_protos": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
diff --git a/python/internal.bzl b/python/internal.bzl
index e9bcb27..d9ba37e 100644
--- a/python/internal.bzl
+++ b/python/internal.bzl
@@ -106,3 +106,20 @@
}),
**kwargs
)
+
+def internal_py_test(deps = [], **kwargs):
+ """Internal wrapper for shared test configuration
+
+ Args:
+ deps: any additional dependencies of the test.
+ **kwargs: arguments forwarded to py_test.
+ """
+ native.py_test(
+ imports = ["."],
+ deps = deps + [":python_test_lib"],
+ target_compatible_with = select({
+ "@system_python//:supported": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ **kwargs
+ )
diff --git a/python/requirements.txt b/python/requirements.txt
deleted file mode 100644
index ed4f89f..0000000
--- a/python/requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-numpy==1.21.6
\ No newline at end of file
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c
index 84c09b8..56157d7 100644
--- a/ruby/ext/google/protobuf_c/ruby-upb.c
+++ b/ruby/ext/google/protobuf_c/ruby-upb.c
@@ -1276,72 +1276,6 @@
-
-
-// Must be last.
-
-#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
-
-struct upb_ExtensionRegistry {
- upb_Arena* arena;
- upb_strtable exts; // Key is upb_MiniTable* concatenated with fieldnum.
-};
-
-static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
- memcpy(buf, &l, sizeof(l));
- memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
-}
-
-upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) {
- upb_ExtensionRegistry* r = upb_Arena_Malloc(arena, sizeof(*r));
- if (!r) return NULL;
- r->arena = arena;
- if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
- return r;
-}
-
-bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
- const upb_MiniTableExtension** e,
- size_t count) {
- char buf[EXTREG_KEY_SIZE];
- const upb_MiniTableExtension** start = e;
- const upb_MiniTableExtension** end = UPB_PTRADD(e, count);
- for (; e < end; e++) {
- const upb_MiniTableExtension* ext = *e;
- extreg_key(buf, ext->extendee, ext->field.number);
- upb_value v;
- if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
- goto failure;
- }
- if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
- upb_value_constptr(ext), r->arena)) {
- goto failure;
- }
- }
- return true;
-
-failure:
- // Back out the entries previously added.
- for (end = e, e = start; e < end; e++) {
- const upb_MiniTableExtension* ext = *e;
- extreg_key(buf, ext->extendee, ext->field.number);
- upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
- }
- return false;
-}
-
-const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
- const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num) {
- char buf[EXTREG_KEY_SIZE];
- upb_value v;
- extreg_key(buf, t, num);
- if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
- return upb_value_getconstptr(v);
- } else {
- return NULL;
- }
-}
-
/*
* upb_table Implementation
*
@@ -4667,12 +4601,6 @@
return upb_Arena_Malloc(a, size);
}
-static void* upb_Arena_doalloc(upb_alloc* alloc, void* ptr, size_t oldsize,
- size_t size) {
- upb_Arena* a = (upb_Arena*)alloc; /* upb_alloc is initial member. */
- return upb_Arena_Realloc(a, ptr, oldsize, size);
-}
-
/* Public Arena API ***********************************************************/
static upb_Arena* arena_initslow(void* mem, size_t n, upb_alloc* alloc) {
@@ -4688,7 +4616,6 @@
a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
n -= sizeof(*a);
- a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
@@ -4722,7 +4649,6 @@
a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
- a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
@@ -4872,19 +4798,6 @@
return sizes[f->descriptortype];
}
-void upb_MiniTable_ClearField(upb_Message* msg,
- const upb_MiniTableField* field) {
- char* mem = UPB_PTR_AT(msg, field->offset, char);
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (_upb_MiniTableField_InOneOf(field)) {
- uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
- }
- memset(mem, 0, _upb_MiniTableField_Size(field));
-}
-
void* upb_MiniTable_ResizeArray(upb_Message* msg,
const upb_MiniTableField* field, size_t len,
upb_Arena* arena) {
@@ -4992,6 +4905,8 @@
if (result.status != kUpb_FindUnknown_Ok) {
return kUpb_GetExtension_NotPresent;
}
+ size_t len;
+ size_t ofs = result.ptr - upb_Message_GetUnknown(msg, &len);
// Decode and promote from unknown.
const upb_MiniTable* extension_table = ext_table->sub.submsg;
upb_UnknownToMessageRet parse_result = upb_MiniTable_ParseUnknownMessage(
@@ -5016,7 +4931,8 @@
}
memcpy(&ext->data, &extension_msg, sizeof(extension_msg));
*extension = ext;
- upb_Message_DeleteUnknown(msg, result.ptr, result.len);
+ const char* delete_ptr = upb_Message_GetUnknown(msg, &len) + ofs;
+ upb_Message_DeleteUnknown(msg, delete_ptr, result.len);
return kUpb_GetExtension_Ok;
}
@@ -5519,11 +5435,13 @@
UPB_PRINTF(2, 3)
UPB_NORETURN static void upb_MtDecoder_ErrorFormat(upb_MtDecoder* d,
const char* fmt, ...) {
- va_list argp;
- upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
- va_start(argp, fmt);
- upb_Status_VAppendErrorFormat(d->status, fmt, argp);
- va_end(argp);
+ if (d->status) {
+ va_list argp;
+ upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
+ va_start(argp, fmt);
+ upb_Status_VAppendErrorFormat(d->status, fmt, argp);
+ va_end(argp);
+ }
UPB_LONGJMP(d->err, 1);
}
@@ -6094,40 +6012,6 @@
d->table->size = UPB_ALIGN_UP(d->table->size, 8);
}
-static void upb_MiniTable_BuildMapEntry(upb_MtDecoder* d, char key_type,
- char val_type) {
- upb_MiniTableField* fields = upb_Arena_Malloc(d->arena, sizeof(*fields) * 2);
- if (!fields) {
- upb_MtDecoder_ErrorFormat(d, "OOM while building map mini table field");
- UPB_UNREACHABLE();
- }
-
- size_t field_size =
- upb_MtDecoder_SizeOfRep(kUpb_FieldRep_StringView, d->platform);
-
- uint32_t sub_count = 0;
- fields[0].number = 1;
- fields[1].number = 2;
- upb_MiniTable_SetField(d, key_type, &fields[0], 0, &sub_count);
- upb_MiniTable_SetField(d, val_type, &fields[1], 0, &sub_count);
- upb_MtDecoder_AllocateSubs(d, sub_count);
-
- // Map entries have a pre-determined layout, regardless of types.
- fields[0].presence = 0;
- fields[1].presence = 0;
- fields[0].offset = 0;
- fields[1].offset = field_size;
-
- upb_MiniTable* ret = d->table;
- ret->size = UPB_ALIGN_UP(2 * field_size, 8);
- ret->field_count = 2;
- ret->ext = kUpb_ExtMode_NonExtendable | kUpb_ExtMode_IsMapEntry;
- ret->dense_below = 2;
- ret->table_mask = -1;
- ret->required_count = 0;
- ret->fields = fields;
-}
-
static void upb_MtDecoder_ParseMap(upb_MtDecoder* d, const char* data,
size_t len) {
if (len < 2) {
@@ -6154,7 +6038,18 @@
upb_MtDecoder_ErrorFormat(d, "Invalid map key field type: %d", key_type);
UPB_UNREACHABLE();
}
- upb_MiniTable_BuildMapEntry(d, data[0], data[1]);
+
+ upb_MtDecoder_ParseMessage(d, data, len);
+ upb_MtDecoder_AssignHasbits(d->table);
+
+ // Map entries have a pre-determined layout, regardless of types.
+ d->fields[0].offset = offsetof(upb_MapEntryData, k);
+ d->fields[1].offset = offsetof(upb_MapEntryData, v);
+ d->table->size = UPB_ALIGN_UP(sizeof(upb_MapEntryData), 8);
+
+ // Map entries have a special bit set to signal it's a map entry, used in
+ // upb_MiniTable_SetSubMessage() below.
+ d->table->ext |= kUpb_ExtMode_IsMapEntry;
}
static void upb_MtDecoder_ParseMessageSet(upb_MtDecoder* d, const char* data,
@@ -6253,7 +6148,7 @@
return d->enum_table;
}
-static void upb_MiniTable_BuildEnumValue(upb_MtDecoder* d, uint32_t val) {
+static void upb_MiniTableEnum_BuildValue(upb_MtDecoder* d, uint32_t val) {
upb_MiniTableEnum* table = d->enum_table;
d->enum_value_count++;
if (table->value_count || (val > 512 && d->enum_value_count < val / 32)) {
@@ -6272,7 +6167,7 @@
}
}
-upb_MiniTableEnum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
upb_Arena* arena,
upb_Status* status) {
upb_MtDecoder decoder = {
@@ -6314,7 +6209,7 @@
if (ch <= kUpb_EncodedValue_MaxEnumMask) {
uint32_t mask = _upb_FromBase92(ch);
for (int i = 0; i < 5; i++, base++, mask >>= 1) {
- if (mask & 1) upb_MiniTable_BuildEnumValue(&decoder, base);
+ if (mask & 1) upb_MiniTableEnum_BuildValue(&decoder, base);
}
} else if (kUpb_EncodedValue_MinSkip <= ch &&
ch <= kUpb_EncodedValue_MaxSkip) {
@@ -6324,7 +6219,7 @@
kUpb_EncodedValue_MaxSkip, &skip);
base += skip;
} else {
- upb_Status_SetErrorFormat(status, "Unexpected character: %c", ch);
+ upb_MtDecoder_ErrorFormat(&decoder, "Unexpected character: %c", ch);
return NULL;
}
}
@@ -6332,7 +6227,7 @@
return decoder.enum_table;
}
-const char* _upb_MiniTable_BuildExtension(const char* data, size_t len,
+const char* _upb_MiniTableExtension_Build(const char* data, size_t len,
upb_MiniTableExtension* ext,
const upb_MiniTable* extendee,
upb_MiniTableSub sub,
@@ -6382,9 +6277,9 @@
return ret;
}
-upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
- upb_MiniTablePlatform platform,
- upb_Arena* arena, upb_Status* status) {
+upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status) {
void* buf = NULL;
size_t size = 0;
upb_MiniTable* ret = upb_MiniTable_BuildWithBuf(data, len, platform, arena,
@@ -6504,7 +6399,7 @@
char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
upb_FieldType key_type,
- upb_FieldType value_type,
+ upb_FieldType value_type, uint64_t key_mod,
uint64_t value_mod) {
upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
in->state.msg_state.msg_modifiers = 0;
@@ -6514,7 +6409,7 @@
ptr = upb_MtDataEncoder_PutRaw(e, ptr, kUpb_EncodedVersion_MapV1);
if (!ptr) return NULL;
- ptr = upb_MtDataEncoder_PutField(e, ptr, key_type, 1, 0);
+ ptr = upb_MtDataEncoder_PutField(e, ptr, key_type, 1, key_mod);
if (!ptr) return NULL;
return upb_MtDataEncoder_PutField(e, ptr, value_type, 2, value_mod);
@@ -6683,6 +6578,72 @@
return upb_MtDataEncoder_FlushDenseEnumMask(e, ptr);
}
+
+
+// Must be last.
+
+#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
+
+struct upb_ExtensionRegistry {
+ upb_Arena* arena;
+ upb_strtable exts; // Key is upb_MiniTable* concatenated with fieldnum.
+};
+
+static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
+ memcpy(buf, &l, sizeof(l));
+ memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
+}
+
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) {
+ upb_ExtensionRegistry* r = upb_Arena_Malloc(arena, sizeof(*r));
+ if (!r) return NULL;
+ r->arena = arena;
+ if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
+ return r;
+}
+
+bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
+ const upb_MiniTableExtension** e,
+ size_t count) {
+ char buf[EXTREG_KEY_SIZE];
+ const upb_MiniTableExtension** start = e;
+ const upb_MiniTableExtension** end = UPB_PTRADD(e, count);
+ for (; e < end; e++) {
+ const upb_MiniTableExtension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_value v;
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ goto failure;
+ }
+ if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
+ upb_value_constptr(ext), r->arena)) {
+ goto failure;
+ }
+ }
+ return true;
+
+failure:
+ // Back out the entries previously added.
+ for (end = e, e = start; e < end; e++) {
+ const upb_MiniTableExtension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
+ }
+ return false;
+}
+
+const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
+ const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num) {
+ char buf[EXTREG_KEY_SIZE];
+ upb_value v;
+ extreg_key(buf, t, num);
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ return upb_value_getconstptr(v);
+ } else {
+ return NULL;
+ }
+}
+
#include <string.h>
@@ -7633,7 +7594,7 @@
upb_Status status;
upb_MiniTableEnum* layout =
- upb_MiniTable_BuildEnum(sv.data, sv.size, ctx->arena, &status);
+ upb_MiniTableEnum_Build(sv.data, sv.size, ctx->arena, &status);
if (!layout)
_upb_DefBuilder_Errf(ctx, "Error building enum MiniTable: %s", status.msg);
return layout;
@@ -8797,7 +8758,7 @@
} else if (_upb_FieldDef_IsClosedEnum(f)) {
sub.subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
}
- bool ok2 = upb_MiniTable_BuildExtension(desc.data, desc.size, mut_ext,
+ bool ok2 = upb_MiniTableExtension_Build(desc.data, desc.size, mut_ext,
upb_MessageDef_MiniTable(m), sub,
ctx->status);
if (!ok2) _upb_DefBuilder_Errf(ctx, "Could not build extension mini table");
@@ -9165,61 +9126,9 @@
// Must be last.
-static size_t get_field_size(const upb_MiniTableField* f) {
- static unsigned char sizes[] = {
- 0, /* 0 */
- 8, /* kUpb_FieldType_Double */
- 4, /* kUpb_FieldType_Float */
- 8, /* kUpb_FieldType_Int64 */
- 8, /* kUpb_FieldType_UInt64 */
- 4, /* kUpb_FieldType_Int32 */
- 8, /* kUpb_FieldType_Fixed64 */
- 4, /* kUpb_FieldType_Fixed32 */
- 1, /* kUpb_FieldType_Bool */
- sizeof(upb_StringView), /* kUpb_FieldType_String */
- sizeof(void*), /* kUpb_FieldType_Group */
- sizeof(void*), /* kUpb_FieldType_Message */
- sizeof(upb_StringView), /* kUpb_FieldType_Bytes */
- 4, /* kUpb_FieldType_UInt32 */
- 4, /* kUpb_FieldType_Enum */
- 4, /* kUpb_FieldType_SFixed32 */
- 8, /* kUpb_FieldType_SFixed64 */
- 4, /* kUpb_FieldType_SInt32 */
- 8, /* kUpb_FieldType_SInt64 */
- };
- return upb_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype];
-}
-
-static bool in_oneof(const upb_MiniTableField* field) {
- return field->presence < 0;
-}
-
-static upb_MessageValue _upb_Message_Getraw(const upb_Message* msg,
- const upb_FieldDef* f) {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- const char* mem = UPB_PTR_AT(msg, field->offset, char);
- upb_MessageValue val = {0};
- memcpy(&val, mem, get_field_size(field));
- return val;
-}
-
bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f) {
- assert(upb_FieldDef_HasPresence(f));
- if (upb_FieldDef_IsExtension(f)) {
- const upb_MiniTableExtension* ext = _upb_FieldDef_ExtensionMiniTable(f);
- return _upb_Message_Getext(msg, ext) != NULL;
- } else {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- if (in_oneof(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- } else if (field->presence > 0) {
- return _upb_hasbit_field(msg, field);
- } else {
- UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message ||
- field->descriptortype == kUpb_FieldType_Group);
- return _upb_Message_Getraw(msg, f).msg_val != NULL;
- }
- }
+ UPB_ASSERT(upb_FieldDef_HasPresence(f));
+ return _upb_MiniTable_HasField(msg, upb_FieldDef_MiniTable(f));
}
const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg,
@@ -9290,22 +9199,7 @@
}
void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f) {
- if (upb_FieldDef_IsExtension(f)) {
- _upb_Message_Clearext(msg, _upb_FieldDef_ExtensionMiniTable(f));
- } else {
- const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
- char* mem = UPB_PTR_AT(msg, field->offset, char);
-
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (in_oneof(field)) {
- uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
- }
-
- memset(mem, 0, get_field_size(field));
- }
+ _upb_MiniTable_ClearField(msg, upb_FieldDef_MiniTable(f));
}
void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m) {
@@ -9317,31 +9211,28 @@
upb_MessageValue* out_val, size_t* iter) {
size_t i = *iter;
size_t n = upb_MessageDef_FieldCount(m);
- const upb_MessageValue zero = {0};
UPB_UNUSED(ext_pool);
- /* Iterate over normal fields, returning the first one that is set. */
+ // Iterate over normal fields, returning the first one that is set.
while (++i < n) {
const upb_FieldDef* f = upb_MessageDef_Field(m, i);
- upb_MessageValue val = _upb_Message_Getraw(msg, f);
+ const upb_MiniTableField* field = upb_FieldDef_MiniTable(f);
+ upb_MessageValue val = upb_Message_Get(msg, f);
- /* Skip field if unset or empty. */
- if (upb_FieldDef_HasPresence(f)) {
+ // Skip field if unset or empty.
+ if (upb_MiniTableField_HasPresence(field)) {
if (!upb_Message_Has(msg, f)) continue;
} else {
- upb_MessageValue test = val;
- if (upb_FieldDef_IsString(f) && !upb_FieldDef_IsRepeated(f)) {
- /* Clear string pointer, only size matters (ptr could be non-NULL). */
- test.str_val.data = NULL;
- }
- /* Continue if NULL or 0. */
- if (memcmp(&test, &zero, sizeof(test)) == 0) continue;
-
- /* Continue on empty array or map. */
- if (upb_FieldDef_IsMap(f)) {
- if (upb_Map_Size(test.map_val) == 0) continue;
- } else if (upb_FieldDef_IsRepeated(f)) {
- if (upb_Array_Size(test.array_val) == 0) continue;
+ switch (upb_FieldMode_Get(field)) {
+ case kUpb_FieldMode_Map:
+ if (!val.map_val || upb_Map_Size(val.map_val) == 0) continue;
+ break;
+ case kUpb_FieldMode_Array:
+ if (!val.array_val || upb_Array_Size(val.array_val) == 0) continue;
+ break;
+ case kUpb_FieldMode_Scalar:
+ if (!_upb_MiniTable_ValueIsNonZero(&val, field)) continue;
+ break;
}
}
@@ -9352,7 +9243,7 @@
}
if (ext_pool) {
- /* Return any extensions that are set. */
+ // Return any extensions that are set.
size_t count;
const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count);
if (i - n < count) {
@@ -9736,6 +9627,7 @@
desc.data, desc.size, kUpb_MiniTablePlatform_Native, ctx->arena,
scratch_data, scratch_size, ctx->status);
if (!ret) _upb_DefBuilder_FailJmp(ctx);
+
return ret;
}
@@ -9757,6 +9649,8 @@
UPB_ASSERT(layout_index < m->layout->field_count);
const upb_MiniTableField* mt_f = &m->layout->fields[layout_index];
UPB_ASSERT(upb_FieldDef_Type(f) == upb_MiniTableField_Type(mt_f));
+ UPB_ASSERT(upb_FieldDef_HasPresence(f) ==
+ upb_MiniTableField_HasPresence(mt_f));
}
#endif
@@ -9874,15 +9768,9 @@
UPB_ASSERT(_upb_FieldDef_LayoutIndex(key_field) == 0);
UPB_ASSERT(_upb_FieldDef_LayoutIndex(val_field) == 1);
- const upb_FieldType key_type = upb_FieldDef_Type(key_field);
- const upb_FieldType val_type = upb_FieldDef_Type(val_field);
-
- const uint64_t val_mod = _upb_FieldDef_IsClosedEnum(val_field)
- ? kUpb_FieldModifier_IsClosedEnum
- : 0;
-
- s->ptr =
- upb_MtDataEncoder_EncodeMap(&s->e, s->ptr, key_type, val_type, val_mod);
+ s->ptr = upb_MtDataEncoder_EncodeMap(
+ &s->e, s->ptr, upb_FieldDef_Type(key_field), upb_FieldDef_Type(val_field),
+ _upb_FieldDef_Modifiers(key_field), _upb_FieldDef_Modifiers(val_field));
return true;
}
@@ -11030,8 +10918,8 @@
const upb_MiniTableField* val_field = &entry->fields[1];
char key_size = kSizeInMap[key_field->descriptortype];
char val_size = kSizeInMap[val_field->descriptortype];
- UPB_ASSERT(key_field->offset == 0);
- UPB_ASSERT(val_field->offset == sizeof(upb_StringView));
+ UPB_ASSERT(key_field->offset == offsetof(upb_MapEntryData, k));
+ UPB_ASSERT(val_field->offset == offsetof(upb_MapEntryData, v));
upb_Map* ret = _upb_Map_New(&d->arena, key_size, val_size);
if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
return ret;
@@ -11058,15 +10946,16 @@
if (entry->fields[1].descriptortype == kUpb_FieldType_Message ||
entry->fields[1].descriptortype == kUpb_FieldType_Group) {
/* Create proactively to handle the case where it doesn't appear. */
- ent.v.val =
+ ent.data.v.val =
upb_value_ptr(_upb_Message_New(entry->subs[0].submsg, &d->arena));
}
const char* start = ptr;
- ptr = _upb_Decoder_DecodeSubMessage(d, ptr, &ent.k, subs, field, val->size);
+ ptr =
+ _upb_Decoder_DecodeSubMessage(d, ptr, &ent.data, subs, field, val->size);
// check if ent had any unknown fields
size_t size;
- upb_Message_GetUnknown(&ent.k, &size);
+ upb_Message_GetUnknown(&ent.data, &size);
if (size != 0) {
uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Delimited;
_upb_Decoder_AddUnknownVarints(d, msg, tag, (uint32_t)(ptr - start));
@@ -11074,7 +10963,8 @@
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
} else {
- if (_upb_Map_Insert(map, &ent.k, map->key_size, &ent.v, map->val_size,
+ if (_upb_Map_Insert(map, &ent.data.k, map->key_size, &ent.data.v,
+ map->val_size,
&d->arena) == kUpb_MapInsertStatus_OutOfMemory) {
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
}
@@ -13148,8 +13038,8 @@
const upb_MiniTableField* val_field = &layout->fields[1];
size_t pre_len = e->limit - e->ptr;
size_t size;
- encode_scalar(e, &ent->v, layout->subs, val_field);
- encode_scalar(e, &ent->k, layout->subs, key_field);
+ encode_scalar(e, &ent->data.v, layout->subs, val_field);
+ encode_scalar(e, &ent->data.k, layout->subs, key_field);
size = (e->limit - e->ptr) - pre_len;
encode_varint(e, size);
encode_tag(e, number, kUpb_WireType_Delimited);
@@ -13179,8 +13069,8 @@
upb_value val;
while (upb_strtable_next2(&map->table, &key, &val, &iter)) {
upb_MapEntry ent;
- _upb_map_fromkey(key, &ent.k, map->key_size);
- _upb_map_fromvalue(val, &ent.v, map->val_size);
+ _upb_map_fromkey(key, &ent.data.k, map->key_size);
+ _upb_map_fromvalue(val, &ent.data.v, map->val_size);
encode_mapentry(e, f->number, layout, &ent);
}
}
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h
index ec2fa4f..793f712 100755
--- a/ruby/ext/google/protobuf_c/ruby-upb.h
+++ b/ruby/ext/google/protobuf_c/ruby-upb.h
@@ -556,11 +556,6 @@
typedef void upb_CleanupFunc(void* context);
typedef struct {
- /* We implement the allocator interface.
- * This must be the first member of upb_Arena!
- * TODO(haberman): remove once handlers are gone. */
- upb_alloc alloc;
-
char *ptr, *end;
} _upb_ArenaHead;
@@ -568,10 +563,11 @@
extern "C" {
#endif
-/* Creates an arena from the given initial block (if any -- n may be 0).
- * Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
- * is a fixed-size arena and cannot grow. */
+// Creates an arena from the given initial block (if any -- n may be 0).
+// Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
+// is a fixed-size arena and cannot grow.
upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
+
void upb_Arena_Free(upb_Arena* a);
bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func);
bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
@@ -579,8 +575,6 @@
size_t upb_Arena_SpaceAllocated(upb_Arena* arena);
uint32_t upb_Arena_DebugRefCount(upb_Arena* arena);
-UPB_INLINE upb_alloc* upb_Arena_Alloc(upb_Arena* a) { return (upb_alloc*)a; }
-
UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) {
_upb_ArenaHead* h = (_upb_ArenaHead*)a;
return (size_t)(h->end - h->ptr);
@@ -1411,6 +1405,216 @@
#endif /* UPB_COLLECTIONS_MAP_INTERNAL_H_ */
+#ifndef UPB_BASE_LOG2_H_
+#define UPB_BASE_LOG2_H_
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+UPB_INLINE int upb_Log2Ceiling(int x) {
+ if (x <= 1) return 0;
+#ifdef __GNUC__
+ return 32 - __builtin_clz(x - 1);
+#else
+ int lg2 = 0;
+ while (1 << lg2 < x) lg2++;
+ return lg2;
+#endif
+}
+
+UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_BASE_LOG2_H_ */
+
+// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
+
+#ifndef UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
+#define UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
+
+#include <stdlib.h>
+
+
+#ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
+#define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
+
+
+// Must be last.
+
+struct upb_Decoder;
+typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data);
+typedef struct {
+ uint64_t field_data;
+ _upb_FieldParser* field_parser;
+} _upb_FastTable_Entry;
+
+typedef enum {
+ kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
+ kUpb_ExtMode_Extendable = 1, // Normal extendable message.
+ kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
+ kUpb_ExtMode_IsMessageSet_ITEM =
+ 3, // MessageSet item (temporary only, see decode.c)
+
+ // During table building we steal a bit to indicate that the message is a map
+ // entry. *Only* used during table building!
+ kUpb_ExtMode_IsMapEntry = 4,
+} upb_ExtMode;
+
+// upb_MiniTable represents the memory layout of a given upb_MessageDef.
+// The members are public so generated code can initialize them,
+// but users MUST NOT directly read or write any of its members.
+struct upb_MiniTable {
+ const upb_MiniTableSub* subs;
+ const upb_MiniTableField* fields;
+
+ // Must be aligned to sizeof(void*). Doesn't include internal members like
+ // unknown fields, extension dict, pointer to msglayout, etc.
+ uint16_t size;
+
+ uint16_t field_count;
+ uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
+ uint8_t dense_below;
+ uint8_t table_mask;
+ uint8_t required_count; // Required fields have the lowest hasbits.
+
+ // To statically initialize the tables of variable length, we need a flexible
+ // array member, and we need to compile in gnu99 mode (constant initialization
+ // of flexible array members is a GNU extension, not in C99 unfortunately.
+ _upb_FastTable_Entry fasttable[];
+};
+
+// Map entries aren't actually stored for map fields, they are only used during
+// parsing. For parsing, it helps a lot if all map entry messages have the same
+// layout. The layout code in mini_table/decode.c will ensure that all map
+// entries have this layout.
+//
+// Note that users can and do create map entries directly, which will also use
+// this layout.
+typedef struct {
+ uint32_t hasbits;
+ union {
+ upb_StringView str; // For str/bytes.
+ upb_value val; // For all other types.
+ } k;
+ union {
+ upb_StringView str; // For str/bytes.
+ upb_value val; // For all other types.
+ } v;
+} upb_MapEntryData;
+
+typedef struct {
+ void* internal_data;
+ upb_MapEntryData data;
+} upb_MapEntry;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Computes a bitmask in which the |l->required_count| lowest bits are set,
+// except that we skip the lowest bit (because upb never uses hasbit 0).
+//
+// Sample output:
+// requiredmask(1) => 0b10 (0x2)
+// requiredmask(5) => 0b111110 (0x3e)
+UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
+ int n = l->required_count;
+ assert(0 < n && n <= 63);
+ return ((1ULL << n) - 1) << 1;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// _upb_mapsorter sorts maps and provides ordered iteration over the entries.
+// Since maps can be recursive (map values can be messages which contain other
+// maps), _upb_mapsorter can contain a stack of maps.
+
+typedef struct {
+ upb_tabent const** entries;
+ int size;
+ int cap;
+} _upb_mapsorter;
+
+typedef struct {
+ int start;
+ int pos;
+ int end;
+} _upb_sortedmap;
+
+UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
+ s->entries = NULL;
+ s->size = 0;
+ s->cap = 0;
+}
+
+UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
+ if (s->entries) free(s->entries);
+}
+
+UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
+ _upb_sortedmap* sorted, upb_MapEntry* ent) {
+ if (sorted->pos == sorted->end) return false;
+ const upb_tabent* tabent = s->entries[sorted->pos++];
+ upb_StringView key = upb_tabstrview(tabent->key);
+ _upb_map_fromkey(key, &ent->data.k, map->key_size);
+ upb_value val = {tabent->val.val};
+ _upb_map_fromvalue(val, &ent->data.v, map->val_size);
+ return true;
+}
+
+UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
+ _upb_sortedmap* sorted) {
+ s->size = sorted->start;
+}
+
+bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
+ const upb_Map* map, _upb_sortedmap* sorted);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
+
+/*
+** Our memory representation for parsing tables and messages themselves.
+** Functions in this file are used by generated code and possibly reflection.
+**
+** The definitions in this file are internal to upb.
+**/
+
+#ifndef UPB_MESSAGE_INTERNAL_H_
+#define UPB_MESSAGE_INTERNAL_H_
+
+#include <stdlib.h>
+#include <string.h>
+
+
+#ifndef UPB_MESSAGE_EXTENSION_INTERNAL_H_
+#define UPB_MESSAGE_EXTENSION_INTERNAL_H_
+
+
// Public APIs for message operations that do not require descriptors.
// These functions can be used even in build that does not want to depend on
// reflection or descriptors.
@@ -1451,130 +1655,6 @@
#endif /* UPB_MESSAGE_MESSAGE_H_ */
-#ifndef UPB_BASE_LOG2_H_
-#define UPB_BASE_LOG2_H_
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-UPB_INLINE int upb_Log2Ceiling(int x) {
- if (x <= 1) return 0;
-#ifdef __GNUC__
- return 32 - __builtin_clz(x - 1);
-#else
- int lg2 = 0;
- while (1 << lg2 < x) lg2++;
- return lg2;
-#endif
-}
-
-UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_BASE_LOG2_H_ */
-
-// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
-
-#ifndef UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
-#define UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_
-
-
-/*
-** Our memory representation for parsing tables and messages themselves.
-** Functions in this file are used by generated code and possibly reflection.
-**
-** The definitions in this file are internal to upb.
-**/
-
-#ifndef UPB_MESSAGE_INTERNAL_H_
-#define UPB_MESSAGE_INTERNAL_H_
-
-#include <stdlib.h>
-#include <string.h>
-
-
-#ifndef UPB_EXTENSION_REGISTRY_H_
-#define UPB_EXTENSION_REGISTRY_H_
-
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Extension registry: a dynamic data structure that stores a map of:
- * (upb_MiniTable, number) -> extension info
- *
- * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
- * binary format.
- *
- * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
- * objects. Like all mini-table objects, it is suitable for reflection-less
- * builds that do not want to expose names into the binary.
- *
- * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
- * allocation and dynamic initialization:
- * * If reflection is being used, then upb_DefPool will construct an appropriate
- * upb_ExtensionRegistry automatically.
- * * For a mini-table only build, the user must manually construct the
- * upb_ExtensionRegistry and populate it with all of the extensions the user
- * cares about.
- * * A third alternative is to manually unpack relevant extensions after the
- * main parse is complete, similar to how Any works. This is perhaps the
- * nicest solution from the perspective of reducing dependencies, avoiding
- * dynamic memory allocation, and avoiding the need to parse uninteresting
- * extensions. The downsides are:
- * (1) parse errors are not caught during the main parse
- * (2) the CPU hit of parsing comes during access, which could cause an
- * undesirable stutter in application performance.
- *
- * Users cannot directly get or put into this map. Users can only add the
- * extensions from a generated module and pass the extension registry to the
- * binary decoder.
- *
- * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
- * reflection do not need to populate a upb_ExtensionRegistry directly.
- */
-
-typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
-
-// Creates a upb_ExtensionRegistry in the given arena.
-// The arena must outlive any use of the extreg.
-upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
-
-// Adds the given extension info for the array |e| of size |count| into the
-// registry. If there are any errors, the entire array is backed out.
-// The extensions must outlive the registry.
-// Possible errors include OOM or an extension number that already exists.
-// TODO: There is currently no way to determine the exact reason for failure.
-bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
- const upb_MiniTableExtension** e,
- size_t count);
-
-// Looks up the extension (if any) defined for message type |t| and field
-// number |num|. Returns the extension if found, otherwise NULL.
-const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
- const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_EXTENSION_REGISTRY_H_ */
-
-#ifndef UPB_MESSAGE_EXTENSION_INTERNAL_H_
-#define UPB_MESSAGE_EXTENSION_INTERNAL_H_
-
-
#ifndef UPB_MINI_TABLE_EXTENSION_INTERNAL_H_
#define UPB_MINI_TABLE_EXTENSION_INTERNAL_H_
@@ -1803,6 +1883,77 @@
#endif /* UPB_MESSAGE_EXTENSION_INTERNAL_H_ */
+#ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
+#define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
+
+
+// Must be last.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Extension registry: a dynamic data structure that stores a map of:
+ * (upb_MiniTable, number) -> extension info
+ *
+ * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
+ * binary format.
+ *
+ * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
+ * objects. Like all mini-table objects, it is suitable for reflection-less
+ * builds that do not want to expose names into the binary.
+ *
+ * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
+ * allocation and dynamic initialization:
+ * * If reflection is being used, then upb_DefPool will construct an appropriate
+ * upb_ExtensionRegistry automatically.
+ * * For a mini-table only build, the user must manually construct the
+ * upb_ExtensionRegistry and populate it with all of the extensions the user
+ * cares about.
+ * * A third alternative is to manually unpack relevant extensions after the
+ * main parse is complete, similar to how Any works. This is perhaps the
+ * nicest solution from the perspective of reducing dependencies, avoiding
+ * dynamic memory allocation, and avoiding the need to parse uninteresting
+ * extensions. The downsides are:
+ * (1) parse errors are not caught during the main parse
+ * (2) the CPU hit of parsing comes during access, which could cause an
+ * undesirable stutter in application performance.
+ *
+ * Users cannot directly get or put into this map. Users can only add the
+ * extensions from a generated module and pass the extension registry to the
+ * binary decoder.
+ *
+ * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
+ * reflection do not need to populate a upb_ExtensionRegistry directly.
+ */
+
+typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
+
+// Creates a upb_ExtensionRegistry in the given arena.
+// The arena must outlive any use of the extreg.
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
+
+// Adds the given extension info for the array |e| of size |count| into the
+// registry. If there are any errors, the entire array is backed out.
+// The extensions must outlive the registry.
+// Possible errors include OOM or an extension number that already exists.
+// TODO: There is currently no way to determine the exact reason for failure.
+bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
+ const upb_MiniTableExtension** e,
+ size_t count);
+
+// Looks up the extension (if any) defined for message type |t| and field
+// number |num|. Returns the extension if found, otherwise NULL.
+const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
+ const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
+
#ifndef UPB_MINI_TABLE_FILE_INTERNAL_H_
#define UPB_MINI_TABLE_FILE_INTERNAL_H_
@@ -1821,79 +1972,6 @@
#endif /* UPB_MINI_TABLE_FILE_INTERNAL_H_ */
-#ifndef UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
-#define UPB_MINI_TABLE_MESSAGE_INTERNAL_H_
-
-
-// Must be last.
-
-struct upb_Decoder;
-typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
- upb_Message* msg, intptr_t table,
- uint64_t hasbits, uint64_t data);
-typedef struct {
- uint64_t field_data;
- _upb_FieldParser* field_parser;
-} _upb_FastTable_Entry;
-
-typedef enum {
- kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
- kUpb_ExtMode_Extendable = 1, // Normal extendable message.
- kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
- kUpb_ExtMode_IsMessageSet_ITEM =
- 3, // MessageSet item (temporary only, see decode.c)
-
- // During table building we steal a bit to indicate that the message is a map
- // entry. *Only* used during table building!
- kUpb_ExtMode_IsMapEntry = 4,
-} upb_ExtMode;
-
-// upb_MiniTable represents the memory layout of a given upb_MessageDef.
-// The members are public so generated code can initialize them,
-// but users MUST NOT directly read or write any of its members.
-struct upb_MiniTable {
- const upb_MiniTableSub* subs;
- const upb_MiniTableField* fields;
-
- // Must be aligned to sizeof(void*). Doesn't include internal members like
- // unknown fields, extension dict, pointer to msglayout, etc.
- uint16_t size;
-
- uint16_t field_count;
- uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
- uint8_t dense_below;
- uint8_t table_mask;
- uint8_t required_count; // Required fields have the lowest hasbits.
-
- // To statically initialize the tables of variable length, we need a flexible
- // array member, and we need to compile in gnu99 mode (constant initialization
- // of flexible array members is a GNU extension, not in C99 unfortunately.
- _upb_FastTable_Entry fasttable[];
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Computes a bitmask in which the |l->required_count| lowest bits are set,
-// except that we skip the lowest bit (because upb never uses hasbit 0).
-//
-// Sample output:
-// requiredmask(1) => 0b10 (0x2)
-// requiredmask(5) => 0b111110 (0x3e)
-UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
- int n = l->required_count;
- assert(0 < n && n <= 63);
- return ((1ULL << n) - 1) << 1;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_MINI_TABLE_MESSAGE_INTERNAL_H_ */
-
// Must be last.
#ifdef __cplusplus
@@ -1973,21 +2051,6 @@
bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
upb_Arena* arena);
-/* Map entries aren't actually stored, they are only used during parsing. For
- * parsing, it helps a lot if all map entry messages have the same layout.
- * The compiler and def.c must ensure that all map entries have this layout. */
-typedef struct {
- upb_Message_Internal internal;
- union {
- upb_StringView str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } k;
- union {
- upb_StringView str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } v;
-} upb_MapEntry;
-
#ifdef __cplusplus
} /* extern "C" */
#endif
@@ -1995,64 +2058,6 @@
#endif /* UPB_MESSAGE_INTERNAL_H_ */
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// _upb_mapsorter sorts maps and provides ordered iteration over the entries.
-// Since maps can be recursive (map values can be messages which contain other
-// maps), _upb_mapsorter can contain a stack of maps.
-
-typedef struct {
- upb_tabent const** entries;
- int size;
- int cap;
-} _upb_mapsorter;
-
-typedef struct {
- int start;
- int pos;
- int end;
-} _upb_sortedmap;
-
-UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
- s->entries = NULL;
- s->size = 0;
- s->cap = 0;
-}
-
-UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
- if (s->entries) free(s->entries);
-}
-
-UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
- _upb_sortedmap* sorted, upb_MapEntry* ent) {
- if (sorted->pos == sorted->end) return false;
- const upb_tabent* tabent = s->entries[sorted->pos++];
- upb_StringView key = upb_tabstrview(tabent->key);
- _upb_map_fromkey(key, &ent->k, map->key_size);
- upb_value val = {tabent->val.val};
- _upb_map_fromvalue(val, &ent->v, map->val_size);
- return true;
-}
-
-UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
- _upb_sortedmap* sorted) {
- s->size = sorted->start;
-}
-
-bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
- const upb_Map* map, _upb_sortedmap* sorted);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-
-#endif /* UPB_COLLECTIONS_MAP_SORTER_INTERNAL_H_ */
-
#ifndef UPB_MINI_TABLE_ENUM_INTERNAL_H_
#define UPB_MINI_TABLE_ENUM_INTERNAL_H_
@@ -2254,6 +2259,15 @@
return field->mode & kUpb_LabelFlags_IsExtension;
}
+UPB_INLINE bool upb_MiniTableField_HasPresence(
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ return !upb_IsRepeatedOrMap(field);
+ } else {
+ return field->presence != 0;
+ }
+}
+
UPB_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
return mini_table->subs[field->submsg_index].submsg;
@@ -2303,8 +2317,8 @@
UPB_INLINE bool upb_MiniTable_HasField(const upb_Message* msg,
const upb_MiniTableField* field);
-UPB_INLINE bool _upb_MiniTable_DefaultIsNonZero(
- const void* default_val, const upb_MiniTableField* field) {
+UPB_INLINE bool _upb_MiniTable_ValueIsNonZero(const void* default_val,
+ const upb_MiniTableField* field) {
char zero[16] = {0};
switch (_upb_MiniTableField_GetRep(field)) {
case kUpb_FieldRep_1Byte:
@@ -2374,7 +2388,7 @@
const void* default_val, void* val) {
UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
if ((_upb_MiniTableField_InOneOf(field) ||
- _upb_MiniTable_DefaultIsNonZero(default_val, field)) &&
+ _upb_MiniTable_ValueIsNonZero(default_val, field)) &&
!upb_MiniTable_HasField(msg, field)) {
_upb_MiniTable_CopyFieldData(val, default_val, field);
return;
@@ -2436,19 +2450,71 @@
}
}
+UPB_INLINE bool _upb_MiniTable_HasExtensionField(
+ const upb_Message* msg, const upb_MiniTableExtension* ext) {
+ UPB_ASSERT(upb_MiniTableField_HasPresence(&ext->field));
+ return _upb_Message_Getext(msg, ext) != NULL;
+}
+
+UPB_INLINE bool _upb_MiniTable_HasNonExtensionField(
+ const upb_Message* msg, const upb_MiniTableField* field) {
+ UPB_ASSERT(upb_MiniTableField_HasPresence(field));
+ UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
+ if (_upb_MiniTableField_InOneOf(field)) {
+ return _upb_getoneofcase_field(msg, field) == field->number;
+ } else {
+ return _upb_hasbit_field(msg, field);
+ }
+}
+
+UPB_INLINE bool _upb_MiniTable_HasField(const upb_Message* msg,
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ return _upb_MiniTable_HasExtensionField(
+ msg, (const upb_MiniTableExtension*)field);
+ } else {
+ return _upb_MiniTable_HasNonExtensionField(msg, field);
+ }
+}
+
+UPB_INLINE void _upb_MiniTable_ClearExtensionField(
+ upb_Message* msg, const upb_MiniTableExtension* ext) {
+ _upb_Message_Clearext(msg, ext);
+}
+
+UPB_INLINE void _upb_MiniTable_ClearNonExtensionField(
+ upb_Message* msg, const upb_MiniTableField* field) {
+ if (field->presence > 0) {
+ _upb_clearhas_field(msg, field);
+ } else if (_upb_MiniTableField_InOneOf(field)) {
+ uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
+ if (*oneof_case != field->number) return;
+ *oneof_case = 0;
+ }
+ const char zeros[16] = {0};
+ _upb_MiniTable_CopyFieldData(_upb_MiniTableField_GetPtr(msg, field), zeros,
+ field);
+}
+
+UPB_INLINE void _upb_MiniTable_ClearField(upb_Message* msg,
+ const upb_MiniTableField* field) {
+ if (upb_MiniTableField_IsExtension(field)) {
+ _upb_Message_Clearext(msg, (const upb_MiniTableExtension*)field);
+ } else {
+ _upb_MiniTable_ClearNonExtensionField(msg, field);
+ }
+}
+
// EVERYTHING ABOVE THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
-void upb_MiniTable_ClearField(upb_Message* msg,
- const upb_MiniTableField* field);
+UPB_INLINE void upb_MiniTable_ClearField(upb_Message* msg,
+ const upb_MiniTableField* field) {
+ _upb_MiniTable_ClearNonExtensionField(msg, field);
+}
UPB_INLINE bool upb_MiniTable_HasField(const upb_Message* msg,
const upb_MiniTableField* field) {
- if (_upb_MiniTableField_InOneOf(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- }
-
- UPB_ASSERT(field->presence > 0);
- return _upb_hasbit_field(msg, field);
+ return _upb_MiniTable_HasNonExtensionField(msg, field);
}
UPB_INLINE bool upb_MiniTable_GetBool(const upb_Message* msg,
@@ -3198,15 +3264,18 @@
(void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* len) {
return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorSet_file(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* len) {
return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, 0, len);
@@ -3256,12 +3325,9 @@
(void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3270,12 +3336,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3284,54 +3351,73 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 40));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 40), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 48));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_dependency(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 48));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(8, 48), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(8, 48), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 56));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_message_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 56));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(12, 56), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 56), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 64));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_enum_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 64));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(16, 64), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 64), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 72));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_service(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 72));
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(20, 72), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 72), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_extension(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 80), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
const google_protobuf_FileOptions* default_val = NULL;
@@ -3340,12 +3426,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 88), const upb_Message*) = NULL;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
const google_protobuf_SourceCodeInfo* default_val = NULL;
@@ -3354,24 +3441,37 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(32, 96));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(32, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 96), len);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(36, 104));
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_public_dependency(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(36, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(36, 104), len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_FileDescriptorProto_weak_dependency(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3380,12 +3480,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(const google_protobuf_FileDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3394,6 +3495,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
+ const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -3540,12 +3645,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -3554,57 +3656,73 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 32));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_field(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 32));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(8, 32), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 40));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_nested_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 40));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 40), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 48));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_enum_type(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 48));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, 3, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(16, 48), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 56));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_extension_range(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 56));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(20, 56), 0, 4, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 56), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_extension(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 64), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
const google_protobuf_MessageOptions* default_val = NULL;
@@ -3613,30 +3731,46 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 72));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(28, 72));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(28, 72), 0, 6, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 72), len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 80));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_oneof_decl(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(32, 80));
+UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(32, 80), 0, 7, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(32, 80), len);
}
-UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(36, 88));
+UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_reserved_range(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(36, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 88), len);
}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_protobuf_DescriptorProto* msg) {
+ size_t size;
+ google_protobuf_DescriptorProto_reserved_name(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -3781,12 +3915,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3795,12 +3926,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3809,12 +3941,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
const google_protobuf_ExtensionRangeOptions* default_val = NULL;
@@ -3823,6 +3956,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -3877,12 +4014,9 @@
(void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3891,12 +4025,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -3905,6 +4040,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -3948,15 +4087,18 @@
(void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) {
+ const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
+ size_t size;
+ google_protobuf_ExtensionRangeOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, 0, len);
@@ -4006,12 +4148,9 @@
(void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4020,12 +4159,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4034,12 +4174,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4048,12 +4189,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = 1;
@@ -4062,12 +4204,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 12, int32_t) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = 1;
@@ -4076,12 +4219,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4090,12 +4234,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4104,12 +4249,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 8);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 88), const upb_Message*) = NULL;
- _upb_clearhas(msg, 8);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
const google_protobuf_FieldOptions* default_val = NULL;
@@ -4118,12 +4264,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 9);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 16), int32_t) = 0;
- _upb_clearhas(msg, 9);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4132,12 +4279,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 10);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 10);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4146,12 +4294,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
- return _upb_hasbit(msg, 11);
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 20), bool) = 0;
- _upb_clearhas(msg, 11);
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
bool default_val = false;
@@ -4160,6 +4309,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
+ const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4238,12 +4391,9 @@
(void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 8, upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4252,12 +4402,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 24), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
const google_protobuf_OneofOptions* default_val = NULL;
@@ -4266,6 +4417,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4317,12 +4472,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4331,21 +4483,25 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_value(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 32), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
const google_protobuf_EnumOptions* default_val = NULL;
@@ -4354,21 +4510,34 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 40));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 40));
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 40), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(12, 40), len);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(16, 48));
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_reserved_range(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 48), len);
}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_EnumDescriptorProto_reserved_name(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4453,12 +4622,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -4467,12 +4633,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
- *UPB_PTR_AT(msg, 8, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
int32_t default_val = (int32_t)0;
@@ -4481,6 +4648,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -4524,12 +4695,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4538,12 +4706,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
int32_t default_val = (int32_t)0;
@@ -4552,12 +4721,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 24), const upb_Message*) = NULL;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
const google_protobuf_EnumValueOptions* default_val = NULL;
@@ -4566,6 +4736,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4620,12 +4794,9 @@
(void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4634,21 +4805,25 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 24));
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 24));
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(4, 24), len);
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
+ size_t size;
+ google_protobuf_ServiceDescriptorProto_method(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 32), const upb_Message*) = NULL;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
const google_protobuf_ServiceOptions* default_val = NULL;
@@ -4657,6 +4832,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4720,12 +4899,9 @@
(void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4734,12 +4910,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4748,12 +4925,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4762,12 +4940,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 56), const upb_Message*) = NULL;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
const google_protobuf_MethodOptions* default_val = NULL;
@@ -4776,12 +4955,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 1), bool) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
bool default_val = false;
@@ -4790,12 +4970,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(9, 2), bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
bool default_val = false;
@@ -4804,6 +4985,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -4867,12 +5052,9 @@
(void)upb_Encode(msg, &google_protobuf_FileOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 24, upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4881,12 +5063,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4895,12 +5078,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
int32_t default_val = 1;
@@ -4909,12 +5093,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 8, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4923,12 +5108,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -4937,12 +5123,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 9, bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4951,12 +5138,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 10, bool) = 0;
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4965,12 +5153,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 8);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 11, bool) = 0;
- _upb_clearhas(msg, 8);
+UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4979,12 +5168,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 9);
+UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 12, bool) = 0;
- _upb_clearhas(msg, 9);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -4993,12 +5183,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 10);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 13, bool) = 0;
- _upb_clearhas(msg, 10);
+UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5007,12 +5198,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 11);
+UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 14, bool) = 0;
- _upb_clearhas(msg, 11);
+UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5021,12 +5213,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 12);
+UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 15, bool) = 0;
- _upb_clearhas(msg, 12);
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
bool default_val = true;
@@ -5035,12 +5228,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 13);
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 13);
+UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5049,12 +5243,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 14);
+UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 14);
+UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5063,12 +5258,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 15);
+UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 15);
+UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5077,12 +5273,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 16);
+UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 16);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5091,12 +5288,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 17);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 17);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5105,12 +5303,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 18);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, 16, bool) = 0;
- _upb_clearhas(msg, 18);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) {
bool default_val = false;
@@ -5119,12 +5318,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 19);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(88, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 19);
+UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5133,12 +5333,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
- return _upb_hasbit(msg, 20);
+UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(96, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 20);
+UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5147,15 +5348,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 184));
+UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 184));
+UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 184), len);
}
+UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
+ size_t size;
+ google_protobuf_FileOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -5265,12 +5473,9 @@
(void)upb_Encode(msg, &google_protobuf_MessageOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5279,12 +5484,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 2, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5293,12 +5499,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 3, bool) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5307,12 +5514,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) {
- *UPB_PTR_AT(msg, 4, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
bool default_val = false;
@@ -5321,15 +5529,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 8);
+UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
- _upb_array_detach(msg, 8);
+UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) {
+ const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 8, len);
}
+UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
+ size_t size;
+ google_protobuf_MessageOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5391,12 +5606,9 @@
(void)upb_Encode(msg, &google_protobuf_FieldOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
int32_t default_val = 0;
@@ -5405,12 +5617,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 8, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5419,12 +5632,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 9, bool) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5433,12 +5647,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 10, bool) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5447,12 +5662,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 12, int32_t) = 0;
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
int32_t default_val = 0;
@@ -5461,12 +5677,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 16, bool) = 0;
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5475,12 +5692,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
- return _upb_hasbit(msg, 7);
+UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions* msg) {
- *UPB_PTR_AT(msg, 17, bool) = 0;
- _upb_clearhas(msg, 7);
+UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
bool default_val = false;
@@ -5489,15 +5707,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24));
+UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(20, 24));
+UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len);
}
+UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
+ size_t size;
+ google_protobuf_FieldOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
@@ -5568,15 +5793,18 @@
(void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) {
+ const upb_MiniTableField field = {999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
+ size_t size;
+ google_protobuf_OneofOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, 0, len);
@@ -5626,12 +5854,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
bool default_val = false;
@@ -5640,12 +5865,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) {
- *UPB_PTR_AT(msg, 2, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
bool default_val = false;
@@ -5654,15 +5880,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
+ size_t size;
+ google_protobuf_EnumOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5718,12 +5951,9 @@
(void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
bool default_val = false;
@@ -5732,15 +5962,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
+ size_t size;
+ google_protobuf_EnumValueOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5793,12 +6030,9 @@
(void)upb_Encode(msg, &google_protobuf_ServiceOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
bool default_val = false;
@@ -5807,15 +6041,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) {
+ const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
+UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
+ size_t size;
+ google_protobuf_ServiceOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5868,12 +6109,9 @@
(void)upb_Encode(msg, &google_protobuf_MethodOptions_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
bool default_val = false;
@@ -5882,12 +6120,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) {
- *UPB_PTR_AT(msg, 4, int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
int32_t default_val = 0;
@@ -5896,15 +6135,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
- return _upb_has_submsg_nohasbit(msg, 8);
+UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
- _upb_array_detach(msg, 8);
+UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) {
+ const upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, 8, len);
}
+UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
+ size_t size;
+ google_protobuf_MethodOptions_uninterpreted_option(msg, &size);
+ return size != 0;
+}
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
@@ -5960,21 +6206,21 @@
(void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
- return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
-}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* len) {
return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
+ size_t size;
+ google_protobuf_UninterpretedOption_name(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -5983,12 +6229,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
uint64_t default_val = (uint64_t)0ull;
@@ -5997,12 +6244,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
int64_t default_val = (int64_t)0ll;
@@ -6011,12 +6259,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), double) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
double default_val = 0;
@@ -6025,12 +6274,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 5);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 5);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6039,12 +6289,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
- return _upb_hasbit(msg, 6);
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 6);
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6053,6 +6304,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
+ const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* len) {
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
@@ -6120,12 +6375,9 @@
(void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
- return _upb_hasbit(msg, 1);
-}
-UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6134,12 +6386,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
- *UPB_PTR_AT(msg, 1, bool) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
bool default_val = false;
@@ -6148,6 +6401,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
@@ -6191,15 +6448,18 @@
(void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* len) {
return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_location(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* len) {
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, 0, len);
@@ -6249,24 +6509,33 @@
(void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 8));
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(8, 16));
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_path(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_path(msg, &size);
+ return size != 0;
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_span(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_span(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6275,12 +6544,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6289,12 +6559,22 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
- _upb_array_detach(msg, UPB_SIZE(12, 56));
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) {
+ const upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 56), len);
}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ size_t size;
+ google_protobuf_SourceCodeInfo_Location_leading_detached_comments(msg, &size);
+ return size != 0;
+}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
@@ -6365,15 +6645,18 @@
(void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
- return _upb_has_submsg_nohasbit(msg, 0);
-}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
- _upb_array_detach(msg, 0);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) {
+ const upb_MiniTableField field = {1, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, 0, len);
}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
+ size_t size;
+ google_protobuf_GeneratedCodeInfo_annotation(msg, &size);
+ return size != 0;
+}
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, 0, len);
@@ -6423,18 +6706,21 @@
(void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msg_init, options, arena, &ptr, len);
return ptr;
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- _upb_array_detach(msg, UPB_SIZE(4, 16));
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {1, UPB_SIZE(4, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 16), len);
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 1);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ size_t size;
+ google_protobuf_GeneratedCodeInfo_Annotation_path(msg, &size);
+ return size != 0;
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
- _upb_clearhas(msg, 1);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
upb_StringView default_val = upb_StringView_FromString("");
@@ -6443,12 +6729,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 2);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 4), int32_t) = 0;
- _upb_clearhas(msg, 2);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = (int32_t)0;
@@ -6457,12 +6744,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 3);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 8), int32_t) = 0;
- _upb_clearhas(msg, 3);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = (int32_t)0;
@@ -6471,12 +6759,13 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- return _upb_hasbit(msg, 4);
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 12), int32_t) = 0;
- _upb_clearhas(msg, 4);
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ _upb_MiniTable_ClearNonExtensionField(msg, &field);
}
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
int32_t default_val = 0;
@@ -6485,6 +6774,10 @@
_upb_MiniTable_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
+ return _upb_MiniTable_HasNonExtensionField(msg, &field);
+}
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 16), len);
@@ -7573,9 +7866,8 @@
typedef enum {
kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
- // upb only.
+ kUpb_EncodedFieldModifier_IsRequired = 1 << 1,
kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
- kUpb_EncodedFieldModifier_IsRequired = 1 << 3,
} upb_EncodedFieldModifier;
enum {
@@ -7656,9 +7948,16 @@
// errors occur, returns NULL and sets a status message. In the success case,
// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
// fields to link the table to the appropriate sub-tables.
-upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
- upb_MiniTablePlatform platform,
- upb_Arena* arena, upb_Status* status);
+upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status);
+
+UPB_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
+ upb_Arena* arena,
+ upb_Status* status) {
+ return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
+ status);
+}
// Links a sub-message field to a MiniTable for that sub-message. If a
// sub-message field is not linked, it will be treated as an unknown field
@@ -7675,21 +7974,21 @@
void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTableField* field,
const upb_MiniTableEnum* sub);
-const char* _upb_MiniTable_BuildExtension(const char* data, size_t len,
+const char* _upb_MiniTableExtension_Build(const char* data, size_t len,
upb_MiniTableExtension* ext,
const upb_MiniTable* extendee,
upb_MiniTableSub sub,
upb_MiniTablePlatform platform,
upb_Status* status);
-UPB_INLINE const char* upb_MiniTable_BuildExtension(
+UPB_INLINE const char* upb_MiniTableExtension_Build(
const char* data, size_t len, upb_MiniTableExtension* ext,
const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
- return _upb_MiniTable_BuildExtension(data, len, ext, extendee, sub,
+ return _upb_MiniTableExtension_Build(data, len, ext, extendee, sub,
kUpb_MiniTablePlatform_Native, status);
}
-upb_MiniTableEnum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
upb_Arena* arena,
upb_Status* status);
@@ -7779,7 +8078,8 @@
// Encodes an entire mini descriptor for a map.
char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
upb_FieldType key_type,
- upb_FieldType value_type, uint64_t value_mod);
+ upb_FieldType value_type, uint64_t key_mod,
+ uint64_t value_mod);
// Encodes an entire mini descriptor for a message set.
char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr);