summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2017-07-11Responded to PR comments.Joshua Haberman
2017-07-08A good start on upb_encode and upb_decode.Josh Haberman
2017-07-05Be more picky about command-line args in upbc.Josh Haberman
2017-07-04First version of a real C codegen for upb.Joshua Haberman
Also includes an implementation of the conformance tests to display what the API usage will be like. There is still a lot to do, and things that are broken (oneofs, repeated fields, etc), but it's a good start.
2016-05-12Added UPB_ASSERT() that helps avoid unused var warnings.Joshua Haberman
* Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT.
2016-04-19Changed schema for JSON test to be defined in a .proto file. (#54)Joshua Haberman
* Changed schema for JSON test to be defined in a .proto file. Before we had lots of code to build these schemas manually, but this was verbose and made it difficult to add to the schema easily. Now we can just write a .proto file and adding fields is easy. To avoid making the tests depend on upbc (and thus Lua) we check in the generated schema. * Made protobuf-compiler a dependency of "make genfiles." * For genfiles download recent protoc that can handle proto3. * Only use new protoc for genfiles.
2016-04-06Changes for PR comments.Josh Haberman
2016-04-05Added upb::FileDef, which represents the file defs are declared in.Josh Haberman
It is entirely optional: MessageDef/EnumDef can still exist on their own. But this can represent a def's file when it is desirable to do so (eg. for code generators). This approach will require that we change the way we handle extensions. But I think it will be a good change overall. Specifically, we previously handled extensions by duplicating the extended message and then adding the extension as a regular field to the duplicated message. This required also duplicating any messages that could reach the extended message. In the new world we will need a way of declaring and looking up extensions separately from the message being extended. This change also involves some notable changes to the generated code: - files are now called foo.upbdefs.h instead of foo.upb.h. This reflects the fact that we might possibly generate several different output files for a .proto file, and this one is just for defs. - we no longer generate selectors in the .h file. - the upbdefs.c no longer vends a SymbolTable. Now it vends the individual messages (and possibly a FileDef later). I think this will compose better once we can generate files where one generated files imports another. We also make the descriptor reader vend a list of FileDefs now. This is the best conceptual match for parsing a FileDescriptorSet.
2015-07-07Also remove license headers from Lua.Josh Haberman
2015-06-02Ported upb to C89, for greater portability.Josh Haberman
A large part of this change contains surface-level porting, like moving variable declarations to the top of the block. However there are a few more substantial things too: - moved internal-only struct definitions to a separate file (structdefs.int.h), for greater encapsulation and ABI compatibility. - removed the UPB_UPCAST macro, since it requires access to the internal-only struct definitions. Replaced uses with calls to inline, type-safe casting functions. - removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros. Class and struct definitions are now more explicit -- you get to see the actual class/struct keywords in the source. The casting convenience functions have been moved into UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2(). - the new way that we duplicate base methods in derived types is also more convenient and requires less duplication. It is also less greppable, but hopefully that is not too big a problem. Compiler flags (-std=c89 -pedantic) should help to rigorously enforce that the code is free of C99-isms. A few functions are not available in C89 (strtoll). There are temporary, hacky solutions in place.
2015-05-28Merge pull request #21 from google/tablestringsJoshua Haberman
Restructure tables for C89 port and smaller size.
2015-05-18Generating enums and intentries only if the tables are non-empty.Martin Maly
2015-05-17Restructure tables for C89 port and smaller size.Josh Haberman
Changes the data layout of tables slightly so that string keys are prefixed with their size, rather than the size being inline in the table itself. This has a few benefits: 1. inttables shrink a bit, because there is no longer a wasted and unused size field sitting in them. 2. This avoids the need to have a union in the table. This is important for an impending C89 port of upb, since C89 has literally no way of statically initializing a non-first union member.
2015-05-13Changes to Lua module loading, and file generation.Josh Haberman
This change has several parts: 1. Resurrected tools/upbc. The code was all there but the build was broken for open-source. Now you can type "make tools/upbc" and it will build all necessary Lua modules and create a robust shell script for running upbc. 2. Changed Lua module loading to no longer rely on OS-level .so dependencies. The net effect of this is that you now only need to set LUA_PATH and LUA_CPATH; setting LD_LIBRARY_PATH or rpaths is no longer required. Downside: this drops compatibility with Lua 5.1, since it depends on a feature that only exists in Lua >=5.2 (and LuaJIT). 3. Since upbc works again, I fixed the re-generation of the descriptor files (descriptor.upb.h, descriptor.upb.c). "make genfiles" will re-generate these as well as the JIT code generator. 4. Added a Travis test target that ensures that the checked-in generated files are not out of date. I would do this for the Ragel generated file also, but we can't count on all versions of Ragel to necessarily generate identical output. 5. Changed Makefile to no longer automatically run Ragel to regenerate the JSON parser. This is unfortuante, because it's convenient when you're developing the JSON parser. However, "git clone" sometimes skews the timestamps a little bit so that "make" thinks it needs to regenerate these files for a fresh "git clone." This would normally be harmless, but if the user doesn't have Ragel installed, it makes the build fail completely. So now you have to explicitly regenerate the Ragel output. If you want to you can uncomment the auto-generation during development.
2014-12-12Amalgamated distribution (upb.c/upb.h) tool.Chris Fallin
There are a number of tweaks to get this to work: - The #include dependence graph wasn't quite complete, and I had to add a few #includes to get the tool to work. - I had to change a number of symbol names to avoid conflicts between 'static' definitions in different .c files. This could be avoided if the tool were smart enough to rename static symbols to have unique prefixes instead, but (i) this requires semantic understanding of C, and (ii) the macro-defined static functions (e.g., handlers for primitive types in several places) would probably trip this up. Verified that the resulting upb.h/upb.c compiles and doesn't have any unresolved references.
2014-11-18Sync to Google-internal development.Josh Haberman
2014-07-02Sync from internal Google development.Josh Haberman
2014-06-26Sync from internal Google development.Josh Haberman
2014-02-04Sync from Google development.Josh Haberman
2014-01-21Sync to internal Google development.Josh Haberman
2013-12-20Sync from Google-internal development.Josh Haberman
2013-10-24Merge from Google-internal development:Josh Haberman
- rewritten decoder; interpreted decoder is bytecode-based, JIT decoder no longer falls back to the interpreter. - C++ improvements: C++11-compatible iterators, upb::reffed_ptr for RAII refcounting, better upcast/downcast support. - removed the gross upb_value abstraction from public upb.h.
2013-05-11Synced with 3 months of Google-internal development.Josh Haberman
Major changes: - Got rid of all bytestream interfaces in favor of using regular handlers. - new Pipeline object represents a upb pipeline, does bump allocation internally to manage memory. - proto2 support now can handle extensions.
2013-02-15Sync with 8 months of Google-internal development.Josh Haberman
Many things have changed and been simplified. The memory-management story for upb_def and upb_handlers is much more robust; upb_def and upb_handlers should be fairly stable interfaces now. There is still much work to do for the runtime component (upb_sink).
2012-03-24Sync from internal Google development.Joshua Haberman
Many improvements, too many to mention. One significant perf regression warrants investigation: omitfp.parsetoproto2_googlemessage1.upb_jit: 343 -> 252 (-26.53) plain.parsetoproto2_googlemessage1.upb_jit: 334 -> 251 (-24.85) 25% regression for this benchmark is bad, but since I don't think there's any fundamental design issue that caused it I'm going to go ahead with the commit anyway. Can investigate and fix later. Other benchmarks were neutral or showed slight improvement.
2011-09-04Const invasion: large parts of upb made const-correct.Joshua Haberman
2011-08-31Header cleanup, clarify/correct comments for interfaces.Joshua Haberman
2011-07-31Fixed "make descriptorgen".Joshua Haberman
2011-07-15Directory restructure.Joshua Haberman
Includes are now via upb/foo.h. Files specific to the protobuf format are now in upb/pb (the core library is concerned with message definitions, handlers, and byte streams, but knows nothing about any particular serializationf format).
2011-02-13Moved upbc -> src/Joshua Haberman
2011-02-13Fix upbc and descriptorgen, and update descriptor.Joshua Haberman
2010-06-26Added constants for field names and numbers.Joshua Haberman
Not used in this branch, but it is used in the src-refactoring branch.
2010-01-16Removed union tag from types.Joshua Haberman
2010-01-15Remove struct keyword from all types, use typedef instead.Joshua Haberman
2010-01-15upb_parser -> upb_decoderJoshua Haberman
2010-01-04upb_array -> upb_arrayptr.Joshua Haberman
2010-01-02Move string representations back upb.h -> upb_data.h.Joshua Haberman
2010-01-02upb_string* -> upb_strptr, to follow aliasing rules.Joshua Haberman
2010-01-01Bugfixes: descriptorgen works without leaks!Joshua Haberman
2009-12-31Other than a couple memory leaks, "make descriptorgen" works again!Joshua Haberman
2009-12-28upbc compiles, but doesn't link due to unimplemented stuff in upb_data.Joshua Haberman
2009-12-28More incremental work; ported some of upbc.Joshua Haberman
2009-12-06Updated upbc to new dyncasts.Joshua Haberman
2009-12-05Add a test for circularly-linked descriptors.Joshua Haberman
The test currently triggers valgrind-detected memory errors.
2009-12-05Scheme for collecting circular refs.Joshua Haberman
"make descriptorgen" is now valgrind-clean again.
2009-12-05Make defs refcounted, rename upb_context->upbsymtab.Joshua Haberman
There is currently a memory leak when type definitions form cycles. This will need to be dealt with.
2009-11-28Overhaul defs to derive from a common base.Joshua Haberman
2009-11-27Update upbc to use self-describing upb_msg instead of void*.Joshua Haberman
2009-11-26Make upb_msgdef own all its data.Joshua Haberman
This is in anticipation of making upb_msgdef's easy to dup. This involved removing all traces of any descriptors from the defs.
2009-11-14Changed parse API to know about msgdefs.Joshua Haberman
This should make it both easier to use and easier to optimize, in exchange for a small amount of generality. In practice, any remotely normal case is still very natural.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback