Thomas Van Lenten
fb2523f51e
Fix up comment to use public api.
...
PiperOrigin-RevId: 544716296
2 years ago
Thomas Van Lenten
cea4551466
Move over some more of FileGenerator to Emit.
...
PiperOrigin-RevId: 544714210
2 years ago
Thomas Van Lenten
70b0769073
Start conversion to use Printer::Emit()
...
Move ImportWriter over and some of FileGenerator.
PiperOrigin-RevId: 544690162
2 years ago
Martijn Vels
d063281036
Internal cleanup
...
PiperOrigin-RevId: 544641683
2 years ago
Sandy Zhang
137e9b57a8
Migrate away from `OneofDescriptor.isSynthetic()`
...
PiperOrigin-RevId: 544416186
2 years ago
Protobuf Team Bot
b17c4f9e5f
Auto-generate files after cl/544398743
2 years ago
Mike Kruskal
272ec6bc12
Internal changes
...
PiperOrigin-RevId: 544398743
2 years ago
Protobuf Team Bot
07c702e7b5
Auto-generate files after cl/544381907
2 years ago
Protobuf Team Bot
200480e83c
Refactor repeated field generators with noop changes related to split repeated fields. Also add TSan validation in _internal_mutable_weak_$name$() for weak message fields, which was missing.
...
PiperOrigin-RevId: 544381907
2 years ago
Sandy Zhang
8ec0295ad7
Unify DescriptorMessageInfoFactory.convert proto2 and proto3 codepaths
...
This handles conversion from descriptors to MessageInfo in a single generic codepath that handles the following differences across syntaxes:
- Enum closedness (proto2)
- Explicit (proto2) vs implicit (proto3) presence
- Required field initialization (proto2)
- UTF8 (proto2/3 specific options)
This also fixes proto3 non-optional messages to encode hasbit, which was updated in cl/542744002
PiperOrigin-RevId: 544358617
2 years ago
Mike Kruskal
a95eb31ac4
Make sure lazily initialized descriptors are loaded before any reflection
...
PiperOrigin-RevId: 544242293
2 years ago
Jason Lunn
15b215f30b
Bulk update to use `assert_*` methods wherever possible. ( #13156 )
...
Influenced by https://minitest.rubystyle.guide/
Closes #13156
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13156 from JasonLunn:flakes-fix 503d3c7745
PiperOrigin-RevId: 544234585
2 years ago
Adam Cozzette
c108278083
Automated rollback of commit 57702831f9
.
...
PiperOrigin-RevId: 544176749
2 years ago
Protobuf Team Bot
57702831f9
Do not store the default instance in the ExtensionIdentifier for message types.
...
It is wasteful because we can materialize it for free from the type already.
PiperOrigin-RevId: 544150353
2 years ago
Mike Kruskal
8298aa57ec
Internal changes
...
PiperOrigin-RevId: 544130465
2 years ago
Protobuf Team Bot
d97c8ed860
internal change
...
PiperOrigin-RevId: 544101673
2 years ago
Protobuf Team Bot
ead5d565e7
Fix hazzer emission of Optional
...
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
2 years ago
Protobuf Team Bot
e2eae81b97
Enable TSan validation to detect when a mutable accessor of a message is called concurrently with another accessor on the same message, which is a data race.
...
This is the third phase, in which we enable validation for string fields.
PiperOrigin-RevId: 544078735
2 years ago
Protobuf Team Bot
68b34feb5a
Add support for int32 in V0.
...
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
2 years ago
Protobuf Team Bot
6035df4a22
Add some extra MUSTTAIL annotations.
...
PiperOrigin-RevId: 543832302
2 years ago
Protobuf Team Bot
76a327e1e1
Fix case of locality optimizer being wrong for split repeated fields and add a check that the optimized order has the same size as the unoptimized order.
...
PiperOrigin-RevId: 543779555
2 years ago
Protobuf Team Bot
ee5cf35c1a
Fix issues involving const_cast and repeated fields in reflection.
...
The motivation is to fix correctness issues seen in split repeated fields.
PiperOrigin-RevId: 543779129
2 years ago
Dave MacLachlan
195bdd0488
Fix `-Wsign-compare` issue
...
PiperOrigin-RevId: 543738795
2 years ago
Protobuf Team Bot
3a95ea12cd
Mark DynamicMessage as final
...
This is to lower the number of vtable accesses.
PiperOrigin-RevId: 543634026
2 years ago
Mike Kruskal
ff0dd3a148
Fix objectivec test failure in Bazel 6+.
...
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
2 years ago
Mike Kruskal
ea51496f6e
Allow safety tag removal from GHA.
...
This was broken by a recent lockdown of GHA permissions.
PiperOrigin-RevId: 543531770
2 years ago
Mike Kruskal
7564894af7
Internal changes
...
PiperOrigin-RevId: 543507207
2 years ago
Protobuf Team Bot
80dbc50118
Enable TSan validation to detect when a mutable accessor of a message is called concurrently with another accessor on the same message, which is a data race.
...
This is the second phase, in which we enable validation for enum/primitive fields.
PiperOrigin-RevId: 543475296
2 years ago
Protobuf Team Bot
f10e56cbe1
Auto-generate files after cl/543465667
2 years ago
Protobuf Team Bot
31e5f5d2c8
Add the RawPtr class, which is used to enable easily keeping a raw pointer to an object that is by default all zero bytes.
...
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
2 years ago
Chris Kennelly
e023e0d23d
Use absl::popcount for obtaining a popcount of set bits.
...
Popcount instructions are widely available on most architectures. Conditioning
the codepath on __POPCNT__ limits the optimization to x86.
PiperOrigin-RevId: 543454555
2 years ago
Protobuf Team Bot
8fe88a5a07
Mark single arg ctor explicit in DynamicMessageFactory.
...
This is in line with best practices since implicit conversion in not necessary nor desired for this class.
PiperOrigin-RevId: 543446110
2 years ago
Protobuf Team Bot
6e9357372b
Follow-up changes to repeated field parsing path.
...
PiperOrigin-RevId: 542972558
2 years ago
Protobuf Team Bot
00d8021801
Auto-generate files after cl/542949247
2 years ago
Adam Cozzette
80df4b29e0
Add `source_file_descriptors` to `CodeGeneratorRequest`
...
PiperOrigin-RevId: 542949247
2 years ago
Protobuf Team Bot
dc934f439f
Miscellaneous fixes for split repeated fields:
...
- 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
2 years ago
Protobuf Team Bot
931412f15d
In Arena::AllocateInternal, avoid instantiating arena_destruct_object<T> in the trivial case and make RepeatedPtrFieldBase arena-compatible.
...
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
2 years ago
Justin Lebar
3d61f9091e
Limit how much memory we'll reserve for repeated enum fields.
...
PiperOrigin-RevId: 542899542
2 years ago
Sandy Zhang
e5936049ae
Unify MessageSchema.parseMessage proto2 and proto3 codepaths
...
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
2 years ago
Sandy Zhang
8113bdef84
Delete legacy generate_changelog.py.
...
PiperOrigin-RevId: 542871417
2 years ago
Protobuf Team Bot
9c256398ab
Make protobuf camelCase name conflicts resolve deterministically.
...
PiperOrigin-RevId: 542864033
2 years ago
Mike Kruskal
a1b3ff0ddb
Automated rollback of commit 3e188b7c04
.
...
PiperOrigin-RevId: 542744002
2 years ago
Protobuf Team Bot
a11f6b6d2a
Auto-generate files after cl/542674144
2 years ago
Mike Kruskal
1b162147d3
Add unit-tests for the C++ generator
...
PiperOrigin-RevId: 542674144
2 years ago
Protobuf Team Bot
b483eccef1
Auto-generate files after cl/542651612
2 years ago
Mike Kruskal
8f84e43231
Split out shared infrastructure from code generator unittest.
...
This will allow us to easily expand it to be used for generator unit-tests.
PiperOrigin-RevId: 542651612
2 years ago
Protobuf Team Bot
6d79d13e47
Enable TSan validation to detect when a mutable accessor of a message is called concurrently with another accessor on the same message, which is a data race.
...
This is the first phase, in which we enable validation for repeated/map fields.
PiperOrigin-RevId: 542623187
2 years ago
Protobuf Team Bot
bcf3e36a48
Let ParseRepeatedStringOnce call AllocateFromStringBlock().
...
PiperOrigin-RevId: 542617650
2 years ago
Mike Kruskal
fd5167d40e
Internal changes
...
PiperOrigin-RevId: 542613464
2 years ago
Protobuf Team Bot
7795c895dd
Automated rollback of commit caf1ce3b35
.
...
PiperOrigin-RevId: 542601832
2 years ago