Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc

Issue 2590803003: Revert "third_party/protobuf: Update to HEAD (83d681ee2c)" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc
diff --git a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc
index e0bd3dac043aea588573ed3c79445cd8b2a9cdf2..bf272596cb2409e824530e2c6c13dba5af82dbe8 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc
+++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc
@@ -180,10 +180,7 @@ MessageGenerator::MessageGenerator(const string& root_classname,
: root_classname_(root_classname),
descriptor_(descriptor),
field_generators_(descriptor, options),
- class_name_(ClassName(descriptor_)),
- deprecated_attribute_(
- GetOptionalDeprecatedAttribute(descriptor, descriptor->file(), false, true)) {
-
+ class_name_(ClassName(descriptor_)) {
for (int i = 0; i < descriptor_->extension_count(); i++) {
extension_generators_.push_back(
new ExtensionGenerator(class_name_, descriptor_->extension(i)));
@@ -249,22 +246,6 @@ void MessageGenerator::DetermineForwardDeclarations(set<string>* fwd_decls) {
}
}
-bool MessageGenerator::IncludesOneOfDefinition() const {
- if (!oneof_generators_.empty()) {
- return true;
- }
-
- for (vector<MessageGenerator*>::const_iterator iter =
- nested_message_generators_.begin();
- iter != nested_message_generators_.end(); ++iter) {
- if ((*iter)->IncludesOneOfDefinition()) {
- return true;
- }
- }
-
- return false;
-}
-
void MessageGenerator::GenerateEnumHeader(io::Printer* printer) {
for (vector<EnumGenerator*>::iterator iter = enum_generators_.begin();
iter != enum_generators_.end(); ++iter) {
@@ -334,7 +315,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
string message_comments;
SourceLocation location;
if (descriptor_->GetSourceLocation(&location)) {
- message_comments = BuildCommentsString(location, false);
+ message_comments = BuildCommentsString(location);
} else {
message_comments = "";
}
@@ -342,7 +323,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
printer->Print(
"$comments$$deprecated_attribute$@interface $classname$ : GPBMessage\n\n",
"classname", class_name_,
- "deprecated_attribute", deprecated_attribute_,
+ "deprecated_attribute", GetOptionalDeprecatedAttribute(descriptor_, false, true),
"comments", message_comments);
vector<char> seen_oneofs(descriptor_->oneof_decl_count(), 0);
@@ -399,14 +380,6 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
"\n",
"classname", class_name_);
- if (!deprecated_attribute_.empty()) {
- // No warnings when compiling the impl of this deprecated class.
- printer->Print(
- "#pragma clang diagnostic push\n"
- "#pragma clang diagnostic ignored \"-Wdeprecated-implementations\"\n"
- "\n");
- }
-
printer->Print("@implementation $classname$\n\n",
"classname", class_name_);
@@ -532,8 +505,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
if (descriptor_->options().message_set_wire_format()) {
init_flags.push_back("GPBDescriptorInitializationFlag_WireFormat");
}
- vars["init_flags"] = BuildFlagsString(FLAGTYPE_DESCRIPTOR_INITIALIZATION,
- init_flags);
+ vars["init_flags"] = BuildFlagsString(init_flags);
printer->Print(
vars,
@@ -591,19 +563,6 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
" [localDescriptor setupExtensionRanges:ranges\n"
" count:(uint32_t)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n");
}
- if (descriptor_->containing_type() != NULL) {
- string parent_class_name = ClassName(descriptor_->containing_type());
- printer->Print(
- " [localDescriptor setupContainingMessageClassName:GPBStringifySymbol($parent_name$)];\n",
- "parent_name", parent_class_name);
- }
- string suffix_added;
- ClassName(descriptor_, &suffix_added);
- if (suffix_added.size() > 0) {
- printer->Print(
- " [localDescriptor setupMessageClassNameSuffix:@\"$suffix$\"];\n",
- "suffix", suffix_added);
- }
printer->Print(
" NSAssert(descriptor == nil, @\"Startup recursed!\");\n"
" descriptor = localDescriptor;\n"
@@ -612,12 +571,6 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
"}\n\n"
"@end\n\n");
- if (!deprecated_attribute_.empty()) {
- printer->Print(
- "#pragma clang diagnostic pop\n"
- "\n");
- }
-
for (int i = 0; i < descriptor_->field_count(); i++) {
field_generators_.get(descriptor_->field(i))
.GenerateCFunctionImplementations(printer);

Powered by Google App Engine
This is Rietveld 408576698