aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/objectivec/objectivec_helpers.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.
* Remove stray indent on normal imports.Gravatar Thomas Van Lenten2018-02-08
|
* 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.
* Support win32 long path for cross compiled buildGravatar Jisi Liu2017-11-10
|
* Make win32_io only for MSVCGravatar Jisi Liu2017-08-11
| | | | | This excludes cygwin and mingw from using the self implemented functions.
* Merge from masterGravatar Jisi Liu2017-07-25
|
* Add std:: namespace prefix to set and map (#3332)Gravatar tanderson-google2017-07-09
| | | * Remove using std::{set,map}
* Add initialized as a reserved keyword as that's the actual property nameGravatar Sergio Campama2017-06-29
|
* Remove "using namespace std" from stubs/common.hGravatar Adam Cozzette2017-04-26
| | | | | | | | This prevents the contents of the std namespace from being effectively pulled into the top-level namespace in all translation units that include common.h. I left in individual using statements for a few common things like std::set and std::map, because it did not seem worth going through the churn of updating the whole codebase to fix those right now.
* Merge pull request #1970 from thomasvl/objc_any_helpersGravatar Thomas Van Lenten2016-09-09
|\ | | | | Objc any helpers
* | Support the -Wassign-enum compiler flag. (#2085)Gravatar Sergio Campamá2016-09-08
| | | | | | | | Support the -Wassign-enum compiler flag.
| * 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
* Support GenerateAll().Gravatar Thomas Van Lenten2016-08-26
| | | | | - Expect calls on GenerateAll() and not Generate(). - Parse the prefix validation file once, and then check all the files.
* 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 better support for protos without packages (#1979)Gravatar Sergio Campamá2016-08-19
| | | | Adds better support for protos without packages and more warnings on possible improvements
* Fixes extra whitespace on generated comments. (#1950)Gravatar Sergio Campamá2016-08-12
| | | | Fixes extra whitespace on generated comments.
* 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
* 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
* Proper checking of enum with non zero defaultGravatar Thomas Van Lenten2016-04-26
| | | | | | | | | proto2 syntax allows the first enum to have a non zero value. This means any field using that default has a non zero default without having an explicit default being set. So when deciding what runtime info is needed, don't rely on an explicit default, always check that the values aren't zero. Fixes https://github.com/google/protobuf/issues/1453
* 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).
* Merge pull request #1291 from sergiocampama/develGravatar Thomas Van Lenten2016-03-14
|\ | | | | Adds more information to Objective C error.
* | Fix up handing of fields with leading names that should be all caps.Gravatar Thomas Van Lenten2016-03-08
| | | | | | | | Add a compile test to confirm things are working as expected.
* | 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.
| * Adds more information to Objective C error when the expected ↵Gravatar Sergio Campama2016-03-03
|/ | | | objc_class_prefix option is missing.
* 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.
* Remove redundant `the` in comments.Gravatar Dongjoon Hyun2016-02-03
|
* Reorder the checks so anything in the expected file is an implicit whitelisting.Gravatar Thomas Van Lenten2015-11-17
| | | | | | In the old flow, any 2 char prefix in the expected file was still generating a warning about being a poor prefix. Now we check the expected file first, so anything expected is let through.
* 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.
* Internal local modifications.Gravatar Bo Yang2015-07-09
|
* 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