Thomas Van Lenten
c57ce72163
Move the rest of FileGenerator over to Emit
...
PiperOrigin-RevId: 544721559
1 year ago
Thomas Van Lenten
fb2523f51e
Fix up comment to use public api.
...
PiperOrigin-RevId: 544716296
1 year ago
Thomas Van Lenten
cea4551466
Move over some more of FileGenerator to Emit.
...
PiperOrigin-RevId: 544714210
1 year ago
Thomas Van Lenten
70b0769073
Start conversion to use Printer::Emit()
...
Move ImportWriter over and some of FileGenerator.
PiperOrigin-RevId: 544690162
1 year ago
Martijn Vels
d063281036
Internal cleanup
...
PiperOrigin-RevId: 544641683
1 year ago
Protobuf Team Bot
b17c4f9e5f
Auto-generate files after cl/544398743
1 year ago
Mike Kruskal
272ec6bc12
Internal changes
...
PiperOrigin-RevId: 544398743
1 year ago
Protobuf Team Bot
07c702e7b5
Auto-generate files after cl/544381907
1 year 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
1 year ago
Mike Kruskal
a95eb31ac4
Make sure lazily initialized descriptors are loaded before any reflection
...
PiperOrigin-RevId: 544242293
1 year ago
Adam Cozzette
c108278083
Automated rollback of commit 57702831f9
.
...
PiperOrigin-RevId: 544176749
1 year 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
1 year ago
Mike Kruskal
8298aa57ec
Internal changes
...
PiperOrigin-RevId: 544130465
1 year ago
Protobuf Team Bot
d97c8ed860
internal change
...
PiperOrigin-RevId: 544101673
1 year 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
1 year 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
1 year 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
1 year ago
Protobuf Team Bot
6035df4a22
Add some extra MUSTTAIL annotations.
...
PiperOrigin-RevId: 543832302
1 year 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
1 year 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
1 year ago
Dave MacLachlan
195bdd0488
Fix `-Wsign-compare` issue
...
PiperOrigin-RevId: 543738795
1 year ago
Protobuf Team Bot
3a95ea12cd
Mark DynamicMessage as final
...
This is to lower the number of vtable accesses.
PiperOrigin-RevId: 543634026
1 year ago
Mike Kruskal
7564894af7
Internal changes
...
PiperOrigin-RevId: 543507207
1 year 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
1 year ago
Protobuf Team Bot
f10e56cbe1
Auto-generate files after cl/543465667
1 year 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
1 year 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
1 year 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
1 year ago
Protobuf Team Bot
6e9357372b
Follow-up changes to repeated field parsing path.
...
PiperOrigin-RevId: 542972558
1 year ago
Protobuf Team Bot
00d8021801
Auto-generate files after cl/542949247
1 year ago
Adam Cozzette
80df4b29e0
Add `source_file_descriptors` to `CodeGeneratorRequest`
...
PiperOrigin-RevId: 542949247
1 year 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
1 year 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
1 year ago
Justin Lebar
3d61f9091e
Limit how much memory we'll reserve for repeated enum fields.
...
PiperOrigin-RevId: 542899542
1 year 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
1 year ago
Protobuf Team Bot
9c256398ab
Make protobuf camelCase name conflicts resolve deterministically.
...
PiperOrigin-RevId: 542864033
1 year ago
Mike Kruskal
a1b3ff0ddb
Automated rollback of commit 3e188b7c04
.
...
PiperOrigin-RevId: 542744002
1 year ago
Protobuf Team Bot
a11f6b6d2a
Auto-generate files after cl/542674144
1 year ago
Mike Kruskal
1b162147d3
Add unit-tests for the C++ generator
...
PiperOrigin-RevId: 542674144
1 year ago
Protobuf Team Bot
b483eccef1
Auto-generate files after cl/542651612
1 year 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
1 year 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
1 year ago
Protobuf Team Bot
bcf3e36a48
Let ParseRepeatedStringOnce call AllocateFromStringBlock().
...
PiperOrigin-RevId: 542617650
1 year ago
Mike Kruskal
fd5167d40e
Internal changes
...
PiperOrigin-RevId: 542613464
1 year ago
Adam Cozzette
ef17a17f56
Fix msan error in generated_message_reflection_unittest.cc
...
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
1 year ago
Protobuf Team Bot
ef64c208f2
Remove TcParser::MpRepeatedGroup().
...
PiperOrigin-RevId: 542360663
1 year ago
Protobuf Team Bot
c3a7be8123
Auto-generate files after cl/542354883
1 year ago
Protobuf Team Bot
c76644863a
Change TSan validation to run in phases to reduce risks of roll backs.
...
TSan validation is currently disabled so this should be a no-op.
PiperOrigin-RevId: 542354883
1 year ago
Protobuf Team Bot
a44fc2b063
compiler: Correct depfile generation when there are no outputs
...
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
1 year ago
Protobuf Team Bot
b0b926a141
Use ProtobufArrayList for repeated bytes field. Presize primitive arrays for fixed-length primitives.
...
PiperOrigin-RevId: 542353392
1 year ago