We were always emitting Optional<T> for accessors, when they should've been behind `_opt`.
We've refactored our previous accessor into `getter` and `getter_opt`. We'll only emit `getter_opt` when we're dealing with optional fields.
PiperOrigin-RevId: 544087591
Needed to lowercase fieldnames and add underscores when they use protected cpp names. Ended up using `cpp::FieldName` from the cpp impl to get this for free.
Also added escaping to Rust accessors, so that protected keywords will compile.
PiperOrigin-RevId: 543995050
This fix works in Bazel 5 and 6, but the original `import pddm` only works in Bazel 5. This is preventing our upgrade to Bazel 6 that will reduce our mac flakes in CI.
PiperOrigin-RevId: 543565397
This class enables storing all such default objects in the same default zero buffer.
The motivation for this is usage in split repeated fields.
PiperOrigin-RevId: 543465667
Popcount instructions are widely available on most architectures. Conditioning
the codepath on __POPCNT__ limits the optimization to x86.
PiperOrigin-RevId: 543454555
- Add an empty() accessor to WeakRepeatedPtrField.
- Don't assume ShouldSplit is false for repeated fields.
- For repeated field tracker generated code, call field internal accessors instead of accessing fields by name.
PiperOrigin-RevId: 542936038
The motivation is that in the case of split repeated fields, we end up calling Arena::CreateMessage<RepeatedPtrFieldBase>, and RepeatedPtrFieldBase has a protected destructor.
PiperOrigin-RevId: 542905924
This handles the following proto2/3 differences in single parseMessage codepath that works for proto2, proto3, and editions
- Groups (proto2)
- Open (proto3) vs closed (proto2) enums, incl closed enums in unknown fields
- Extensions (proto2)
- No presence (proto3)
PiperOrigin-RevId: 542872685
This test was failing in opt mode, because without the debug checks we were
running into undefined behavior. This CL fixes the problem by making sure we
only exercise this error case in non-opt builds.
PiperOrigin-RevId: 542382472
Prevents the compiler from generating a malformed depfile if an inpout file did not lead to any meaningful generation. This is an edge case that is not exercised often.
PiperOrigin-RevId: 542354842
Adding to a temporary array of values on stack, then merging it to RepeatedField
minimizes dynamic growth of RepeatedField.
PiperOrigin-RevId: 542123764
Note that TSan validation is currently disabled, but this will prevent regressions of code depending on message sizes being the same with/without TSan mode.
PiperOrigin-RevId: 542048650