Eric Salo
3c295eccf9
clean up the mini descriptor code:
...
- Correctly set the modifier field for MessageDefs
- Add error handling
- Respect the provided arena, stop hardwiring the global alloc
- upb_MiniDescriptor_EncodeExtension() is now upb_MiniDescriptor_EncodeField()
- Make the plugin code a lot easier to read
PiperOrigin-RevId: 460482002
2 years ago
Protobuf Team Bot
201a79071a
Update C++ generator.
...
PiperOrigin-RevId: 459633873
2 years ago
Protobuf Team Bot
ec110d9aaa
Remove SortedEnums from generator which is now in file_layout.h/cc.
...
PiperOrigin-RevId: 459348088
2 years ago
Protobuf Team Bot
ff46379efe
Prepare build for C++ generator.
...
PiperOrigin-RevId: 459265699
2 years ago
Protobuf Team Bot
8c44f04697
create and lock down upb/internal/array.h
...
Internal array functions are now implemented in upb/internal/array.c and declared in
upb/internal/array.h, which only has local visibility.
PiperOrigin-RevId: 458260144
2 years ago
Protobuf Team Bot
46e306bead
Move generator shared support code to common target.
...
PiperOrigin-RevId: 458257330
2 years ago
Protobuf Team Bot
b6f862bf9f
Fix message clear not updating hasbit when message/group has presence. Add more tests.
...
PiperOrigin-RevId: 457822583
2 years ago
Protobuf Team Bot
a6cbda7b7b
remove redundant declaration from generated code
...
It turns out that forward-declaring:
struct foo;
is redundant when combined with:
typedef struct foo foo;
Which is exactly what we were doing in the generated upb code. So, simplify it!
PiperOrigin-RevId: 456590031
2 years ago
Protobuf Team Bot
65bde4e75b
upb_Encode() now returns a status value
...
PiperOrigin-RevId: 454740100
2 years ago
Protobuf Team Bot
65cd34dd00
The mini descriptor encoder now uses the internal api (upb_MessageDef, upb_FileDef, etc) instead of dealing directly with the proto fields. So much simpler and cleaner!
...
PiperOrigin-RevId: 454389613
2 years ago
Protobuf Team Bot
bb38fc9c4d
First implementation of protoc-gen-upbdev plugin
...
PiperOrigin-RevId: 454243195
3 years ago
Joshua Haberman
76c7ca9327
Updated API for accessing extensions.
...
PiperOrigin-RevId: 442947856
3 years ago
Joshua Haberman
fa8b605f78
Implemented MiniDescriptors for proto2 enums.
...
An enum MiniDescriptor simply encodes a set of valid `int32_t` values, so that the protobuf parser can test whether a given enum value is known or not.
The format implemented here is novel and needs to be documented. In short, the format is:
1. base92 values 0-31: 5-bit mask indicating presence or absence of the next five enum values.
2. base92 values 60-91: varint indicating skip over a region of enum values.
Negative enum values are encoded as their `uint32_t` equivalent.
PiperOrigin-RevId: 442892799
3 years ago
Protobuf Team
e1e7435e70
Internal change
...
PiperOrigin-RevId: 440796832
3 years ago
Joshua Haberman
9cc02bb60d
Rewrote the MessageSet parsing code in the upb decoder to properly handle several edge cases.
...
PiperOrigin-RevId: 440788402
3 years ago
Protobuf Team
bef53686ec
Add support for clear field in upbc.
...
Add support for setting extension field value.
PiperOrigin-RevId: 439365359
3 years ago
Joshua Haberman
b25e7218ef
Call reserve() before push_back().
...
PiperOrigin-RevId: 436318676
3 years ago
Joshua Haberman
c6dae657fb
Reserve elements from vector before calling push_back().
3 years ago
Protobuf Team
b0f55f0879
Reserve vector capacity prior to calling `push_back()` in a loop.
...
PiperOrigin-RevId: 435111851
3 years ago
Protobuf Team
b8edc7153f
Internal change
...
PiperOrigin-RevId: 435056074
3 years ago
Joshua Haberman
a9e894dbbc
Addressed PR comments.
3 years ago
Joshua Haberman
cb55c4d781
Addressed PR comments.
3 years ago
Joshua Haberman
20e7802fca
Clang-format.
3 years ago
Joshua Haberman
d1a6423600
A bit more refactoring and comments.
3 years ago
Joshua Haberman
75660afaa5
Moved class definitions out of line.
3 years ago
Joshua Haberman
911a25e738
Passes nearly all tests!
3 years ago
Joshua Haberman
273398ca5f
Removed MessageLayout from upbc.
3 years ago
Joshua Haberman
169bc6a83c
Changed many strings in the compiler to use "cc" raw strings.
...
These strings can be formatted by clang-format.
3 years ago
Joshua Haberman
5b711f286b
WIP.
3 years ago
Joshua Haberman
e0aaad386f
Passes all conformance tests!
3 years ago
Joshua Haberman
c3d8ef7939
Get packed flag working.
3 years ago
Joshua Haberman
03c1fe48c4
We are passing most tests and most conformance tests!
...
Proto2 enum mini-table building is not yet implemented.
3 years ago
Joshua Haberman
7c541f0ba6
(NFC) Refactored upbc header generation into smaller methods.
...
This is in anticipation of a larger upcoming refactor.
3 years ago
Joshua Haberman
04e4276ea2
WIP.
3 years ago
Joshua Haberman
76a81e2177
WIP.
3 years ago
Joshua Haberman
8a6f9591d8
WIP.
3 years ago
Joshua Haberman
532dc1f0f0
Renamed a few more constants to the new style.
...
These are not in the public API and so were not prioritized before.
No functional change here, just renames.
3 years ago
Joshua Haberman
7647b79403
WIP.
3 years ago
Joshua Haberman
af6574a416
WIP.
3 years ago
Samuel Benzaquen
8d755661aa
Update protoc-gen-upbdefs.cc
3 years ago
Samuel Benzaquen
aa779cd779
Update protoc-gen-upb.cc
3 years ago
Joshua Haberman
ecc8bae4ce
Fix for proto2 files that use proto3 enums.
3 years ago
Joshua Haberman
992448eefe
Addressed PR comments.
3 years ago
Joshua Haberman
9715597895
Fixed clang-format.
3 years ago
Joshua Haberman
2e141b24fc
Addressed PR comments.
3 years ago
Joshua Haberman
85072ce04e
Fixed a bug in enum layout generation.
3 years ago
Joshua Haberman
65a85a63c8
Fixed two bugs with proto2 enums:
...
1. The mask was getting improperly truncated for values 32-63.
2. We were not handling duplicated enum values.
3 years ago
Joshua Haberman
74bc67bbbc
WIP
3 years ago
Joshua Haberman
32038c1c59
New API for building extensions appears to work.
3 years ago
Joshua Haberman
2dad1f94a2
MiniTable builder is successfully working on all files!
3 years ago