Joshua Haberman
6178a0bf3c
Removed tautological comparisons of `(size_t)index > 0`.
...
Example:
```
bazel-out/k8-fastbuild/bin/protos_generator/tests/test_model.upb.proto.cc: In member function 'void protos_generator::test::protos::internal::TestModelV1Access::set_value4(size_t, int32_t)':
bazel-out/k8-fastbuild/bin/protos_generator/tests/test_model.upb.proto.cc:559:14: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
559 | assert(0 <= index && index < len);
```
PiperOrigin-RevId: 489086133
2 years ago
Joshua Haberman
677b928a44
Removed a few more uses of std::iterator that I missed before.
...
PiperOrigin-RevId: 489072541
2 years ago
Joshua Haberman
7c20721f3e
Removed use of std::iterator, which is deprecated in C++17.
...
PiperOrigin-RevId: 489038355
2 years ago
Laramie Leavitt
7d76251d9f
Split upb_amalgamation into a separate .bzl file
...
PiperOrigin-RevId: 489034477
2 years ago
Protobuf Team Bot
0184441169
Update C++ compiler to prefix enum and messages defined with no package name to avoid C include collisions.
...
PiperOrigin-RevId: 489023142
2 years ago
Protobuf Team Bot
d3ec4b63c9
Add Parse/Serialize templates to support shared_ptr/unique_ptr.
...
Fix UBSAN in _upb_Message_Clear due to unsigned UPB_PTR_AT
PiperOrigin-RevId: 489007182
2 years ago
Eric Salo
4d3998b54b
consolidate some general parsing functions into upb/lex/
...
There are several other functions which might eventually end up here and ideally become unified across json/ and text/ and io/ so this is just a first step to create the new subdir and get rid of upb/internal/
PiperOrigin-RevId: 488954926
2 years ago
Protobuf Team Bot
afd43b8ba4
Fix a build error when using upb_cc_proto_library.
...
PiperOrigin-RevId: 488941778
2 years ago
Protobuf Team Bot
d76e286631
Fix C compiler failure when there are fields names prefixed with accessor prefixes such as set_ and clear_.
...
PiperOrigin-RevId: 488672865
2 years ago
Anton Grbin
c4f1d1bab1
Copybara import of the project:
...
--
064b263c42
by Anton Grbin <anton@noom.com>:
squash and rebase
PiperOrigin-RevId: 488667851
2 years ago
Joshua Haberman
023c4da591
Enabled TAP testing for upb on Windows via Lexan.
...
We disable targets that are not currently working on Windows.
PiperOrigin-RevId: 488560033
2 years ago
Eric Salo
b3cb3fbea8
create upb/hash/
...
The next lowest build target to scrub is the hash table. We already have a few
other things called 'table' (mini table, fast table) so let's just go with
'hash' here. Split apart the headers into int and str branches sharing common
definitions. Leave the core functions in a single .c for inlining.
PiperOrigin-RevId: 488388767
2 years ago
Eric Salo
ff8e1b40ba
create base/ subdir and expand :status build target to :base
...
upb.h is now just a temporary stub
PiperOrigin-RevId: 488255988
2 years ago
Eric Salo
632471333c
clean up the build targets for collections, mem, reflection
...
PiperOrigin-RevId: 488226166
2 years ago
Eric Salo
33633fd604
generated code now uses the scalar get accessors
...
Also tweaked the generator to only emit a call to UPB_SIZE() when the two input values are actually different.
PiperOrigin-RevId: 487606926
2 years ago
Mike Kruskal
2b011bc759
Internal changes
...
PiperOrigin-RevId: 487599716
2 years ago
Eric Salo
0e76047f5f
add defaults to the mini table scalar getter accessor functions
...
also inline upb_MiniTable_HasField()
PiperOrigin-RevId: 487588457
2 years ago
Protobuf Team Bot
721c284959
Use UPB_SETJMP macro
...
PiperOrigin-RevId: 487009840
2 years ago
Eric Salo
aec12a466f
upb: split out :status as a separate build target
...
This should allow other upb components to depend upon the zcis without causing a cycle
PiperOrigin-RevId: 486987806
2 years ago
Eric Salo
a77b9665e1
move lua/ up to the top level directory where python/ lives
...
PiperOrigin-RevId: 486786325
2 years ago
Protobuf Team Bot
d4425d3f5b
Refactor out functions to get hasbit offset and mask.
...
PiperOrigin-RevId: 486738238
2 years ago
Eric Salo
75907f7af9
rename the upb_MiniTable subtypes to follow the upb style guide:
...
upb_MiniTable_Enum -> upb_MiniTableEnum
upb_MiniTable_Extension -> upb_MiniTableExtension
upb_MiniTable_Field -> upb_MiniTableField
upb_MiniTable_File -> upb_MiniTableFile
upb_MiniTable_Sub -> upb_MiniTableSub
PiperOrigin-RevId: 486712960
2 years ago
Eric Salo
cb7a51938c
inline the trivial int conversion functions in the code generator
...
PiperOrigin-RevId: 486670074
2 years ago
Eric Salo
f6307877d3
move portability stuff into upb/port/
...
Also delete redundant system #includes that are already pulled in by port/def.inc
PiperOrigin-RevId: 486398989
2 years ago
Eric Salo
46699b72ad
move message set enums into upb/wire/ (and use them)
...
PiperOrigin-RevId: 486366363
2 years ago
Eric Salo
5f1ff7c94a
change mini_table accessors test from the C encoder to the C++ encoder
...
PiperOrigin-RevId: 486363897
2 years ago
Copybara-Service
50a01524dc
Merge pull request #901 from limdor:patch-3
...
PiperOrigin-RevId: 486361732
2 years ago
Xavier Bonaventura
7de6cf7a7d
Build with incompatible_disallow_empty_glob
...
In order to flip the flag, all downstream projects should be adapted.
However, it is hard to fix them all if there are constant regressions.
Adding it to the CI will ensure that once the project can build with
incompatible_disallow_empty_glob it can keep building like that.
See: https://github.com/bazelbuild/bazel/pull/15327
2 years ago
Eric Salo
fd040a8bff
create collections/map_internal.h and collections/map_gencode_util.h
...
Move the map-related functions from msg_internal.h that are only used in generated code into map_gencode_util.h. Then move the rest of the map-related functions from msg_internal.h into map_internal.h.
PiperOrigin-RevId: 486299140
2 years ago
Protobuf Team Bot
a4779ef5f8
internal change
...
PiperOrigin-RevId: 486275169
2 years ago
Protobuf Team Bot
f345caf115
Update diagnostics for GCC warning
...
PiperOrigin-RevId: 486274318
2 years ago
Jie Luo
73661563db
Added is_closed to EnumDescriptor in protobuf python upb
...
PiperOrigin-RevId: 486253678
2 years ago
Protobuf Team Bot
0f4fffef16
Update config_setting visibility in support of --incompatible_config_setting_private_default_visibility.
...
For https://github.com/bazelbuild/bazel/issues/12933 .
PiperOrigin-RevId: 486230747
2 years ago
Protobuf Team Bot
306123e2e8
C++ Code generator
...
PiperOrigin-RevId: 486158566
2 years ago
Eric Salo
fd14316f38
create collections/ subdir for all array and map code
...
PiperOrigin-RevId: 486013554
2 years ago
Joshua Haberman
115b878a5c
Optimization: do not generate oneofs for proto3 optional fields.
...
Proto3 optional fields should use a hasbit for their presence. But we had been giving them oneof layouts, which makes them unnecessarily large. This CL will shrink messages with proto3 optional fields, by using hasbits instead of oneof cases for them.
PiperOrigin-RevId: 485998527
2 years ago
Joshua Haberman
93fee65c55
Merge pull request #884 from acozzette/test-cmake-generation
...
Make trivial change to CMakeLists.txt to test auto-generation
2 years ago
Eric Salo
d9b6f13cde
remove upb_MtDataEncoder from the public surface
...
PiperOrigin-RevId: 485928803
2 years ago
Eric Salo
0bb466356d
create text/ subdir for all text-format code
...
Currently all we have is an encoder but eventually a decoder will also go here.
PiperOrigin-RevId: 485911424
2 years ago
Protobuf Team Bot
9b8785ebd3
Pin Upb to C++ 17
...
Update rules_fuzzing to v0.3.2
PiperOrigin-RevId: 485902979
2 years ago
Eric Salo
e137175092
create wire/ subdir for all wire-format code
...
PiperOrigin-RevId: 485898080
2 years ago
Eric Salo
f409c9985b
create mem/ subdir for all arena code
...
PiperOrigin-RevId: 485884460
2 years ago
Mike Kruskal
5ba0d84c88
Internal Change
...
PiperOrigin-RevId: 485726227
2 years ago
Adam Cozzette
496276471d
Make trivial change to CMakeLists.txt to test auto-generation
...
If the auto-generation is working correctly, then CMakeLists.txt should
be quickly auto-updated with a change that undoes this one.
2 years ago
Eric Salo
c033eff26f
split apart mini_table.c into a new subdir
...
PiperOrigin-RevId: 484352293
2 years ago
Joshua Haberman
6c4dc6f9e8
Merge pull request #873 from acozzette/update-cmake-files
...
Check in generated CMake files
2 years ago
Eric Salo
5c646803ef
implement mini descriptors for message sets
...
PiperOrigin-RevId: 484058392
2 years ago
Eric Salo
cb5be728d7
fix bug in mini descriptor map decoder
...
PiperOrigin-RevId: 483960513
2 years ago
Mike Kruskal
41017ef8dc
Fixes https://github.com/protocolbuffers/upb/issues/869
...
PiperOrigin-RevId: 483794621
2 years ago
Adam Cozzette
52be7c2960
Check in generated CMake files
...
Once the GitHub action is fixed, these will be auto-updated whenever
necessary. I realized it would be a good idea to add them back first,
though, just to make sure nothing breaks before we enable the
auto-updating.
2 years ago