From bc53c1bc4621e172a20fb0966c7ee9342d9a8dda Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 14 Oct 2015 18:02:34 -0700 Subject: Add flag to MessageDef for whether fields have presence. --- upb/structdefs.int.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'upb/structdefs.int.h') diff --git a/upb/structdefs.int.h b/upb/structdefs.int.h index e650c32..b7b36fa 100644 --- a/upb/structdefs.int.h +++ b/upb/structdefs.int.h @@ -114,6 +114,11 @@ struct upb_msgdef { * descriptor.upb.c. */ bool map_entry; + /* Do primitive values in this message have explicit presence or not? + * TODO: set this flag properly for static descriptors; regenerate + * descriptor.upb.c. */ + bool primitives_have_presence; + /* TODO(haberman): proper extension ranges (there can be multiple). */ }; @@ -124,7 +129,7 @@ struct upb_msgdef { { \ UPB_DEF_INIT(name, UPB_DEF_MSG, refs, ref2s), selector_count, \ submsg_field_count, itof, ntof, \ - UPB_EMPTY_STRTABLE_INIT(UPB_CTYPE_PTR), false \ + UPB_EMPTY_STRTABLE_INIT(UPB_CTYPE_PTR), false, true \ } -- cgit v1.2.3