aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/objectivec/objectivec_file.cc
Commit message (Collapse)AuthorAge
* Don't generate imports for the WKTs unless generating the WKTs.Gravatar Thomas Van Lenten2018-04-02
| | | | | Since the generated header import GPBProtocolBuffers.h, there is no need to generate imports for the WKTs as they will have already been imported.
* Trim imports for bundled generated protos.Gravatar Thomas Van Lenten2018-04-02
| | | | | | | | To avoid a cycle between headers, have the WKTs use minimal imports instead of using the helper to get everything from the library. Fixes https://github.com/google/protobuf/issues/4301 Fixes https://github.com/google/protobuf/issues/4403
* Removed using statements from common.hGravatar Adam Cozzette2018-01-26
| | | | | | These statements pulled a bunch of symbols from the std namespace into the global namespace. This commit removes all of them except for std::string, which is a bit trickier to remove.
* Add an explicit import of stdatomic.h.Gravatar Thomas Van Lenten2018-01-25
| | | | | | | | | The generated code for enums needs atomics support, so generate the import instead of relying on it via transitive imports. This will make future changes to this likely likely to break generated code and runtime support are mixed. Followup to https://github.com/google/protobuf/pull/4184.
* Add std:: namespace prefix to set and map (#3332)Gravatar tanderson-google2017-07-09
| | | * Remove using std::{set,map}
* Update the ObjC version checks to support a min and current version.Gravatar Thomas Van Lenten2016-09-15
| | | | | | | | | - Capture the version used to generated. - Check at compile time and runtime that generated code isn't from a newer version, also check that the min version required is also supported. - Keep the old constants/macros/functions to special case the last version that was working so those generated sources still work until we decide otherwise.
* Merge pull request #2090 from guoxiao/findGravatar Feng Xiao2016-09-09
|\ | | | | include std::find()
* | Add ObjC helpers for Any WKT.Gravatar Thomas Van Lenten2016-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capture the ObjC prefix used when generating the the file. - Track the containing type on descriptors. - Mark descriptors where the message class name got a suffix added to it. - Expose a fullName property on Descriptors. - Add helpers for packing/unpacking Any messages. - Bump the ObjC runtime version number. Since we added methods and invoke them in the generated code, ensure the code is running against a matching version. Otherwise, someone could compile against headers, but run with a framework that is older and get unknown selector failures. This should trip clearer messaging. Fixes https://github.com/google/protobuf/issues/1674
| * include std::find()Gravatar Guo Xiao2016-09-08
|/
* Make Root's +extensionRegistry generation smarter.Gravatar Thomas Van Lenten2016-09-01
| | | | | | | At generation time, walk the file's dependencies to see what really contains extensions so we can generate more minimal code that only links together the roots that provided extensions. Gets a bunch of otherwise noop code out of the call flow when the roots are +initialized.
* Speed up ObjC Generation with large dependency treesGravatar Thomas Van Lenten2016-08-30
| | | | | | | | | Don't create FileGenerators for each dep. FileGenerators will deeply create all the message, enum, and field generators; but those aren't needed when doing the imports for dependencies. Instead directly generate the imports off the FileDescriptors so no extra objects are created. The only other use was when chaining together the *Roots for the file extension registry, but that also can be generate off the name of the FileDescriptor directly.
* Remove the compiler options from ImportWriter.Gravatar Thomas Van Lenten2016-08-23
| | | | | | | | Breaks the tie of the ImportWriter to the ObjC generation, allow grpc to use a different extension and to relay the values they need for these. - Pass in the two framework options to the ctor. - Pass in the header extension to AddFile.
* Move the ImportWriter into the ObjC Helpers.Gravatar Thomas Van Lenten2016-08-23
| | | | | grpc likely needs to provide the same sorta handling, so expose the class so the logic can be reused.
* Adds support for appledoc in generated code. (#1928)Gravatar Sergio Campamá2016-08-09
| | | | | | Convert mapping of proto comments to appledoc format so they show up in Xcode and cocoadocs. Fixes https://github.com/google/protobuf/issues/1866
* Fixes the parsing of the proto-framework map file.Gravatar Sergio Campama2016-07-22
| | | | | - Fixes memory issue where the pointer to the StringPiece would be allocated on the stack, and would mangle the output. - Fixes length of the file name when parsing the comma separated files.
* Add new generation option for using proto sources from other frameworks.Gravatar Thomas Van Lenten2016-06-17
| | | | | | | | | | | | | | - Better docs in the generator for the different options that can be passed during an invoke of protoc. - Add named_framework_to_proto_path_mappings_path to pass the path to a file containing mappings of frameworks for different proto files. - Update the generation to use the mapping to change the #import directives it creates. Note: the changes in helpers is mostly moving code within the fine, and then a small change to expose the parsing so a passed on class can consume the line. Fixes https://github.com/google/protobuf/issues/1457
* Add support for generation sources into a framework.Gravatar Thomas Van Lenten2016-06-15
| | | | | | | | | | - Add a protoc objc option (generate_for_named_framework) to set the name of the framework all generated sources will be in. - Tweak some comments/naming to make it clear what is the Protobuf framework vs. the framework for generated code. - Update the objc README to document the new generation option to protoc. This is working towards https://github.com/google/protobuf/issues/1457.
* Add more warnings to for the ObjC runtime buildGravatar Thomas Van Lenten2016-05-25
| | | | | | | | | | | | | | Working on https://github.com/google/protobuf/issues/1599, specifically: - Turn on more warnings that the Xcode UI calls out with individual controls. - Manually add: -Wundef -Wswitch-enum - Manually add and then diable in the unittests because of XCTest's headers: -Wreserved-id-macro -Wdocumentation-unknown-command - Manually add -Wdirect-ivar-access, but disable it for the unittests and in the library code (via #pragmas to suppress it). This is done so proto users can enable the warning.
* Better support for using the proto library from a framework.Gravatar Thomas Van Lenten2016-05-24
| | | | | | | | | | | | | | - Add generator constant for the default framework name. - Add generator api for making the CPP symbol from the name. - Add generator api to see if it is a bundled proto file. - Output a CPP conditional and two imports for the core library headers. - Add helper for generating the #import for file headers to deal with the framework imports. - Add a reference from the unittests to a WKT to use that to inspect how imports generate. - Update the podspec to define the CPP symbol and require pods 1.0 (or later). Fixes https://github.com/google/protobuf/issues/1457
* Added deprecated option handling for objective-c generatorGravatar Oleg Vereshko2016-04-04
|
* Shrink ObjC overhead (generated size and some runtime sizes)Gravatar Thomas Van Lenten2016-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: This is a binary breaking change as structure sizes have changed size and/or order. - Drop capturing field options, no other options were captured and other mobile targeted languages don't try to capture this sort information (saved 8 bytes for every field defined (in static data and again in field descriptor instance size data). - No longer generate/compile in the messages/enums in descriptor.proto. If developers need it, they should generate it and compile it in. Reduced the overhead of the core library. - Compute the number of has_bits actually needs to avoid over reserving. - Let the boolean single fields store via a has_bit to avoid storage, makes the common cases of the instance size smaller. - Reorder some flags and down size the enums to contain the bits needed. - Reorder the items in the structures to manually ensure they are are packed better (especially when generating 64bit code - 8 bytes for every field, 16 bytes for every extension, instance sizes 8 bytes also). - Split off the structure initialization so when the default is zero, the generated static storage doesn't need to reserve the space. This is batched at the message level, so all the fields for the message have to have zero defaults to get the saves. By definition all proto3 syntax files fall into this case but it also saves space for the proto2 that use the standard defaults. (saves 8 bytes of static data for every field that had a zero default) - Don't track the enums defined by a message. Nothing in the runtime needs it and it was just generation and runtime overhead. (saves 8 bytes per enum) - Ensure EnumDescriptors are started up threadsafe in all cases. - Split some of the Descriptor initialization into multiple methods so the generated code isn't padded with lots of zero/nil args. - Change how oneof info is feed to the runtime enabling us to generate less static data (8 bytes saved per oneof for 64bit). - Change how enum value informat is capture to pack the data and only decode it if it ends up being needed. Avoids padding issues causing bloat of 64bit, and removes the needs for extra pointers in addition to the data (just the data and one pointer now).
* HeaderDoc support in the library and generated sourcesGravatar Thomas Van Lenten2016-03-07
| | | | | | | - Convert most of the core library headers over to HeaderDoc format. - Switch the generated comments over to HeaderDoc. - Create GPBCodedOutputStream_PackagePrivate and move some things into there that should be more internal.
* Support ObjC Generic CollectionsGravatar Thomas Van Lenten2016-02-18
| | | | | | | - Extend GPB*ObjectDictionary to support generic syntax. - Update the generator to output generics so the enclosed type is exposed for compiler checks. - Use generics in a the public interfaces. - Update the generated sources that are checked in.
* Tweak the error message as the generate is in the core binary these days.Gravatar Thomas Van Lenten2015-12-02
|
* Add support for a file listing expected package to objc prefixes for validation.Gravatar Thomas Van Lenten2015-08-14
| | | | | | - Add a env var to pass a set of expected prefixes for validation. - Report warnings/errors based on the expected prefixes vs. the data in the files compiled. - Use some helpers from common directory.
* Remove unused .pb.h #includes.Gravatar Bo Yang2015-08-06
|
* Add nonnil markup to ObjC library.Gravatar Thomas Van Lenten2015-06-16
| | | | Add the clang annotations to the objc library and generated code to help with Swift bridging and compiler checks.
* Beta quality drop of Objective C Support.Gravatar Thomas Van Lenten2015-06-08
| | | | | | | | | | | | | | | - Add more to the ObjC dir readme. - Merge the ExtensionField and ExtensionDescriptor to reduce overhead. - Fix an initialization race. - Clean up the Xcode schemes. - Remove the class/enum filter. - Remove some forced inline that were bloating things without proof of performance wins. - Rename some internal types to avoid conflicts with the well know types protos. - Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants. - Better document some possible future improvements. - Add missing support for parsing repeated primitive fields in packed or unpacked forms. - Improve -hash. - Add *Count for repeated and map<> fields to avoid auto create when checking for them being set.
* Objective C Second Alpha DropGravatar Thomas Van Lenten2015-05-22
| | | | | | | | | | - Style fixups in the code. - map<> serialization fixes and more tests. - Autocreation of map<> fields (to match repeated fields). - @@protoc_insertion_point(global_scope|imports). - Fixup proto2 syntax extension support. - Move all startup code to +initialize so it happen on class usage and not app startup. - Have generated headers use forward declarations and move imports into generated code, reduces what is need at compile time to speed up compiled and avoid pointless rippling of rebuilds.
* Getting the ObjC generator building on Windows.Gravatar Thomas Van Lenten2015-05-19
| | | | | | | | | Remove the ClassList support (maybe bring it back in the future). Trim the includes to hopefully get a working Window build. Add some more returns after switches for compilers that warn even when all values of the enum are handled. Use ghtonl instead of htonl. Change the use of [u]int(8,32)_t within the ObjC generator code to [u]int(8,32) to match the rest of the compiler. Add objective-c generator files to Visual Studio project.
* Alpha 1 drop of Google's Objective C plugin and runtime support for protobufs.Gravatar Thomas Van Lenten2015-05-06