protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
35 #include <google/protobuf/compiler/cpp/cpp_helpers.h>
36 
37 #include <cstdint>
38 #include <functional>
39 #include <limits>
40 #include <map>
41 #include <queue>
42 #include <unordered_set>
43 #include <vector>
44 
45 #include <google/protobuf/stubs/common.h>
46 #include <google/protobuf/stubs/logging.h>
47 #include <google/protobuf/compiler/cpp/cpp_options.h>
49 #include <google/protobuf/descriptor.pb.h>
50 #include <google/protobuf/descriptor.h>
51 #include <google/protobuf/compiler/scc.h>
52 #include <google/protobuf/io/printer.h>
53 #include <google/protobuf/io/zero_copy_stream.h>
54 #include <google/protobuf/dynamic_message.h>
55 #include <google/protobuf/wire_format.h>
56 #include <google/protobuf/wire_format_lite.h>
57 #include <google/protobuf/stubs/strutil.h>
58 #include <google/protobuf/stubs/substitute.h>
59 #include <google/protobuf/stubs/hash.h>
60 
61 // Must be last.
62 #include <google/protobuf/port_def.inc>
63 
64 namespace google {
65 namespace protobuf {
66 namespace compiler {
67 namespace cpp {
68 
69 namespace {
70 
71 static const char kAnyMessageName[] = "Any";
72 static const char kAnyProtoFile[] = "google/protobuf/any.proto";
73 
75  return StringReplace(name, ".", "::", true);
76 }
77 
78 static const char* const kKeywordList[] = { //
79  "NULL",
80  "alignas",
81  "alignof",
82  "and",
83  "and_eq",
84  "asm",
85  "auto",
86  "bitand",
87  "bitor",
88  "bool",
89  "break",
90  "case",
91  "catch",
92  "char",
93  "class",
94  "compl",
95  "const",
96  "constexpr",
97  "const_cast",
98  "continue",
99  "decltype",
100  "default",
101  "delete",
102  "do",
103  "double",
104  "dynamic_cast",
105  "else",
106  "enum",
107  "explicit",
108  "export",
109  "extern",
110  "false",
111  "float",
112  "for",
113  "friend",
114  "goto",
115  "if",
116  "inline",
117  "int",
118  "long",
119  "mutable",
120  "namespace",
121  "new",
122  "noexcept",
123  "not",
124  "not_eq",
125  "nullptr",
126  "operator",
127  "or",
128  "or_eq",
129  "private",
130  "protected",
131  "public",
132  "register",
133  "reinterpret_cast",
134  "return",
135  "short",
136  "signed",
137  "sizeof",
138  "static",
139  "static_assert",
140  "static_cast",
141  "struct",
142  "switch",
143  "template",
144  "this",
145  "thread_local",
146  "throw",
147  "true",
148  "try",
149  "typedef",
150  "typeid",
151  "typename",
152  "union",
153  "unsigned",
154  "using",
155  "virtual",
156  "void",
157  "volatile",
158  "wchar_t",
159  "while",
160  "xor",
161  "xor_eq"};
162 
163 static std::unordered_set<std::string>* MakeKeywordsMap() {
164  auto* result = new std::unordered_set<std::string>();
165  for (const auto keyword : kKeywordList) {
166  result->emplace(keyword);
167  }
168  return result;
169 }
170 
171 static std::unordered_set<std::string>& kKeywords = *MakeKeywordsMap();
172 
173 std::string IntTypeName(const Options& options, const std::string& type) {
174  return type + "_t";
175 }
176 
177 void SetIntVar(const Options& options, const std::string& type,
178  std::map<std::string, std::string>* variables) {
179  (*variables)[type] = IntTypeName(options, type);
180 }
181 bool IsEagerlyVerifiedLazyImpl(const FieldDescriptor* field,
182  const Options& options,
183  MessageSCCAnalyzer* scc_analyzer) {
184  return false;
185 }
186 
187 } // namespace
188 
190  MessageSCCAnalyzer* scc_analyzer) {
192  IsEagerlyVerifiedLazyImpl(field, options, scc_analyzer);
193 }
194 
195 void SetCommonVars(const Options& options,
196  std::map<std::string, std::string>* variables) {
197  (*variables)["proto_ns"] = ProtobufNamespace(options);
198 
199  // Warning: there is some clever naming/splitting here to avoid extract script
200  // rewrites. The names of these variables must not be things that the extract
201  // script will rewrite. That's why we use "CHK" (for example) instead of
202  // "GOOGLE_CHECK".
203  if (options.opensource_runtime) {
204  (*variables)["GOOGLE_PROTOBUF"] = "GOOGLE_PROTOBUF";
205  (*variables)["CHK"] = "GOOGLE_CHECK";
206  (*variables)["DCHK"] = "GOOGLE_DCHECK";
207  } else {
208  // These values are things the extract script would rewrite if we did not
209  // split them. It might not strictly matter since we don't generate google3
210  // code in open-source. But it's good to prevent surprising things from
211  // happening.
212  (*variables)["GOOGLE_PROTOBUF"] =
213  "GOOGLE3"
214  "_PROTOBUF";
215  (*variables)["CHK"] =
216  "CH"
217  "ECK";
218  (*variables)["DCHK"] =
219  "DCH"
220  "ECK";
221  }
222 
223  SetIntVar(options, "int8", variables);
224  SetIntVar(options, "uint8", variables);
225  SetIntVar(options, "uint32", variables);
226  SetIntVar(options, "uint64", variables);
227  SetIntVar(options, "int32", variables);
228  SetIntVar(options, "int64", variables);
229  (*variables)["string"] = "std::string";
230 }
231 
233  const Options& options,
234  std::map<std::string, std::string>* variables) {
236  std::string unknown_fields_type;
237  if (UseUnknownFieldSet(descriptor->file(), options)) {
238  unknown_fields_type = "::" + proto_ns + "::UnknownFieldSet";
239  (*variables)["unknown_fields"] =
240  "_internal_metadata_.unknown_fields<" + unknown_fields_type + ">(" +
241  unknown_fields_type + "::default_instance)";
242  } else {
243  unknown_fields_type =
245  (*variables)["unknown_fields"] = "_internal_metadata_.unknown_fields<" +
246  unknown_fields_type + ">(::" + proto_ns +
247  "::internal::GetEmptyString)";
248  }
249  (*variables)["unknown_fields_type"] = unknown_fields_type;
250  (*variables)["have_unknown_fields"] =
251  "_internal_metadata_.have_unknown_fields()";
252  (*variables)["mutable_unknown_fields"] =
253  "_internal_metadata_.mutable_unknown_fields<" + unknown_fields_type +
254  ">()";
255 }
256 
258  bool cap_next_letter) {
260  // Note: I distrust ctype.h due to locales.
261  for (int i = 0; i < input.size(); i++) {
262  if ('a' <= input[i] && input[i] <= 'z') {
263  if (cap_next_letter) {
264  result += input[i] + ('A' - 'a');
265  } else {
266  result += input[i];
267  }
268  cap_next_letter = false;
269  } else if ('A' <= input[i] && input[i] <= 'Z') {
270  // Capital letters are left as-is.
271  result += input[i];
272  cap_next_letter = false;
273  } else if ('0' <= input[i] && input[i] <= '9') {
274  result += input[i];
275  cap_next_letter = true;
276  } else {
277  cap_next_letter = true;
278  }
279  }
280  return result;
281 }
282 
283 const char kThickSeparator[] =
284  "// ===================================================================\n";
285 const char kThinSeparator[] =
286  "// -------------------------------------------------------------------\n";
287 
289  if (field->is_repeated() || field->is_extension()) return false;
290  switch (field->cpp_type()) {
292  return field->default_value_enum()->number() == 0;
294  return field->default_value_int32() == 0;
296  return field->default_value_int64() == 0;
298  return field->default_value_uint32() == 0;
300  return field->default_value_uint64() == 0;
302  return field->default_value_float() == 0;
304  return field->default_value_double() == 0;
306  return field->default_value_bool() == false;
307  default:
308  return false;
309  }
310 }
311 
313  const Descriptor* parent = descriptor->containing_type();
314  std::string res;
315  if (parent) res += ClassName(parent) + "_";
316  res += descriptor->name();
317  if (IsMapEntryMessage(descriptor)) res += "_DoNotUse";
318  return ResolveKeyword(res);
319 }
320 
322  if (enum_descriptor->containing_type() == nullptr) {
323  return ResolveKeyword(enum_descriptor->name());
324  } else {
325  return ClassName(enum_descriptor->containing_type()) + "_" +
326  enum_descriptor->name();
327  }
328 }
329 
330 std::string QualifiedClassName(const Descriptor* d, const Options& options) {
331  return QualifiedFileLevelSymbol(d->file(), ClassName(d), options);
332 }
333 
335  const Options& options) {
336  return QualifiedFileLevelSymbol(d->file(), ClassName(d), options);
337 }
338 
340  return QualifiedClassName(d, Options());
341 }
342 
344  return QualifiedClassName(d, Options());
345 }
346 
348  if (const Descriptor* scope = d->extension_scope())
349  return StrCat(ClassName(scope), "::", ResolveKeyword(d->name()));
350  return ResolveKeyword(d->name());
351 }
352 
354  const Options& options) {
355  GOOGLE_DCHECK(d->is_extension());
356  return QualifiedFileLevelSymbol(d->file(), ExtensionName(d), options);
357 }
358 
360  return QualifiedExtensionName(d, Options());
361 }
362 
363 std::string Namespace(const std::string& package) {
364  if (package.empty()) return "";
365  return "::" + DotsToColons(package);
366 }
367 
368 std::string Namespace(const FileDescriptor* d, const Options& options) {
369  std::string ret = Namespace(d->package());
370  if (IsWellKnownMessage(d) && options.opensource_runtime) {
371  // Written with string concatenation to prevent rewriting of
372  // ::google::protobuf.
374  "::google::"
375  "protobuf",
376  "::PROTOBUF_NAMESPACE_ID", false);
377  }
378  return ret;
379 }
380 
381 std::string Namespace(const Descriptor* d, const Options& options) {
382  return Namespace(d->file(), options);
383 }
384 
385 std::string Namespace(const FieldDescriptor* d, const Options& options) {
386  return Namespace(d->file(), options);
387 }
388 
389 std::string Namespace(const EnumDescriptor* d, const Options& options) {
390  return Namespace(d->file(), options);
391 }
392 
394  const Options& options) {
395  return ClassName(descriptor) + "DefaultTypeInternal";
396 }
397 
399  const Options& options) {
400  return "_" + ClassName(descriptor, false) + "_default_instance_";
401 }
402 
404  const Options& options) {
405  return DefaultInstanceName(descriptor, options) + "ptr_";
406 }
407 
409  const Options& options) {
412 }
413 
415  const Options& options) {
417 }
418 
420  const Options& options) {
421  return UniqueName("descriptor_table", file, options);
422 }
423 
424 std::string FileDllExport(const FileDescriptor* file, const Options& options) {
425  return UniqueName("PROTOBUF_INTERNAL_EXPORT", file, options);
426 }
427 
429  const Options& options) {
430  if (!HasDescriptorMethods(descriptor->file(), options)) {
431  return "::" + ProtobufNamespace(options) + "::MessageLite";
432  }
433  auto simple_base = SimpleBaseClass(descriptor, options);
434  if (simple_base.empty()) {
435  return "::" + ProtobufNamespace(options) + "::Message";
436  }
437  return "::" + ProtobufNamespace(options) + "::internal::" + simple_base;
438 }
439 
441  if (kKeywords.count(name) > 0) {
442  return name + "_";
443  }
444  return name;
445 }
446 
448  std::string result = field->name();
450  if (kKeywords.count(result) > 0) {
451  result.append("_");
452  }
453  return result;
454 }
455 
457  GOOGLE_DCHECK(field->containing_oneof());
458  std::string field_name = UnderscoresToCamelCase(field->name(), true);
459  return "k" + field_name;
460 }
461 
463  GOOGLE_DCHECK(field->containing_oneof());
464  const std::string qualification =
465  QualifiedClassName(field->containing_type());
466  return StrCat(qualification, "::", OneofCaseConstantName(field));
467 }
468 
469 std::string EnumValueName(const EnumValueDescriptor* enum_value) {
470  std::string result = enum_value->name();
471  if (kKeywords.count(result) > 0) {
472  result.append("_");
473  }
474  return result;
475 }
476 
478  if (field == nullptr) return 0;
479  if (field->is_repeated()) return 8;
480  switch (field->cpp_type()) {
482  return 1;
483 
488  return 4;
489 
495  return 8;
496  }
497  GOOGLE_LOG(FATAL) << "Can't get here.";
498  return -1; // Make compiler happy.
499 }
500 
502  std::string field_name = UnderscoresToCamelCase(field->name(), true);
503  std::string result = "k" + field_name + "FieldNumber";
504 
505  if (!field->is_extension() &&
506  field->containing_type()->FindFieldByCamelcaseName(
507  field->camelcase_name()) != field) {
508  // This field's camelcase name is not unique. As a hack, add the field
509  // number to the constant name. This makes the constant rather useless,
510  // but what can we do?
511  result += "_" + StrCat(field->number());
512  }
513 
514  return result;
515 }
516 
518  const Options& options) {
519  // Note: The Google-internal version of Protocol Buffers uses this function
520  // as a hook point for hacks to support legacy code.
521  return QualifiedClassName(field->message_type(), options);
522 }
523 
525  /*
526  * TODO(github/georgthegreat) remove this proxy method
527  * once Google's internal codebase will become ready
528  */
530 }
531 
533  switch (type) {
535  return "int32_t";
537  return "int64_t";
539  return "uint32_t";
541  return "uint64_t";
543  return "double";
545  return "float";
547  return "bool";
549  return "int";
551  return "std::string";
553  return nullptr;
554 
555  // No default because we want the compiler to complain if any new
556  // CppTypes are added.
557  }
558 
559  GOOGLE_LOG(FATAL) << "Can't get here.";
560  return nullptr;
561 }
562 
563 std::string PrimitiveTypeName(const Options& options,
565  switch (type) {
567  return IntTypeName(options, "int32");
569  return IntTypeName(options, "int64");
571  return IntTypeName(options, "uint32");
573  return IntTypeName(options, "uint64");
575  return "double";
577  return "float";
579  return "bool";
581  return "int";
583  return "std::string";
585  return "";
586 
587  // No default because we want the compiler to complain if any new
588  // CppTypes are added.
589  }
590 
591  GOOGLE_LOG(FATAL) << "Can't get here.";
592  return "";
593 }
594 
596  switch (type) {
598  return "Int32";
600  return "Int64";
602  return "UInt32";
604  return "UInt64";
606  return "SInt32";
608  return "SInt64";
610  return "Fixed32";
612  return "Fixed64";
614  return "SFixed32";
616  return "SFixed64";
618  return "Float";
620  return "Double";
621 
623  return "Bool";
625  return "Enum";
626 
628  return "String";
630  return "Bytes";
632  return "Group";
634  return "Message";
635 
636  // No default because we want the compiler to complain if any new
637  // types are added.
638  }
639  GOOGLE_LOG(FATAL) << "Can't get here.";
640  return "";
641 }
642 
645  // This needs to be special-cased, see explanation here:
646  // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661
647  return StrCat(number + 1, " - 1");
648  } else {
649  return StrCat(number);
650  }
651 }
652 
655  // This needs to be special-cased, see explanation here:
656  // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661
657  return StrCat("int64_t{", number + 1, "} - 1");
658  }
659  return StrCat("int64_t{", number, "}");
660 }
661 
663  return StrCat("uint64_t{", number, "u}");
664 }
665 
667  return DefaultValue(Options(), field);
668 }
669 
670 std::string DefaultValue(const Options& options, const FieldDescriptor* field) {
671  switch (field->cpp_type()) {
673  return Int32ToString(field->default_value_int32());
675  return StrCat(field->default_value_uint32()) + "u";
677  return Int64ToString(field->default_value_int64());
679  return UInt64ToString(field->default_value_uint64());
681  double value = field->default_value_double();
682  if (value == std::numeric_limits<double>::infinity()) {
683  return "std::numeric_limits<double>::infinity()";
684  } else if (value == -std::numeric_limits<double>::infinity()) {
685  return "-std::numeric_limits<double>::infinity()";
686  } else if (value != value) {
687  return "std::numeric_limits<double>::quiet_NaN()";
688  } else {
689  return SimpleDtoa(value);
690  }
691  }
693  float value = field->default_value_float();
694  if (value == std::numeric_limits<float>::infinity()) {
695  return "std::numeric_limits<float>::infinity()";
696  } else if (value == -std::numeric_limits<float>::infinity()) {
697  return "-std::numeric_limits<float>::infinity()";
698  } else if (value != value) {
699  return "std::numeric_limits<float>::quiet_NaN()";
700  } else {
701  std::string float_value = SimpleFtoa(value);
702  // If floating point value contains a period (.) or an exponent
703  // (either E or e), then append suffix 'f' to make it a float
704  // literal.
705  if (float_value.find_first_of(".eE") != std::string::npos) {
706  float_value.push_back('f');
707  }
708  return float_value;
709  }
710  }
712  return field->default_value_bool() ? "true" : "false";
714  // Lazy: Generate a static_cast because we don't have a helper function
715  // that constructs the full name of an enum value.
716  return strings::Substitute(
717  "static_cast< $0 >($1)", ClassName(field->enum_type(), true),
718  Int32ToString(field->default_value_enum()->number()));
720  return "\"" +
721  EscapeTrigraphs(CEscape(field->default_value_string())) +
722  "\"";
724  return "*" + FieldMessageTypeName(field, options) +
725  "::internal_default_instance()";
726  }
727  // Can't actually get here; make compiler happy. (We could add a default
728  // case above but then we wouldn't get the nice compiler warning when a
729  // new type is added.)
730  GOOGLE_LOG(FATAL) << "Can't get here.";
731  return "";
732 }
733 
734 // Convert a file name into a valid identifier.
737  for (int i = 0; i < filename.size(); i++) {
738  if (ascii_isalnum(filename[i])) {
739  result.push_back(filename[i]);
740  } else {
741  // Not alphanumeric. To avoid any possibility of name conflicts we
742  // use the hex code for the character.
743  StrAppend(&result, "_",
744  strings::Hex(static_cast<uint8_t>(filename[i])));
745  }
746  }
747  return result;
748 }
749 
751  const Options& options) {
752  return name + "_" + FilenameIdentifier(filename);
753 }
754 
755 // Return the qualified C++ name for a file level symbol.
757  const std::string& name,
758  const Options& options) {
759  if (file->package().empty()) {
760  return StrCat("::", name);
761  }
762  return StrCat(Namespace(file, options), "::", name);
763 }
764 
765 // Escape C++ trigraphs by escaping question marks to \?
766 std::string EscapeTrigraphs(const std::string& to_escape) {
767  return StringReplace(to_escape, "?", "\\?", true);
768 }
769 
770 // Escaped function name to eliminate naming conflict.
772  const FieldDescriptor* field,
773  const std::string& prefix) {
774  // Do not use FieldName() since it will escape keywords.
775  std::string name = field->name();
776  LowerString(&name);
777  std::string function_name = prefix + name;
778  if (descriptor->FindFieldByName(function_name)) {
779  // Single underscore will also make it conflicting with the private data
780  // member. We use double underscore to escape function names.
781  function_name.append("__");
782  } else if (kKeywords.count(name) > 0) {
783  // If the field name is a keyword, we append the underscore back to keep it
784  // consistent with other function names.
785  function_name.append("_");
786  }
787  return function_name;
788 }
789 
791  const Options& options) {
792  (void)descriptor;
793  (void)options;
794  return false;
795 }
796 
797 static bool HasLazyFields(const Descriptor* descriptor, const Options& options,
798  MessageSCCAnalyzer* scc_analyzer) {
799  for (int field_idx = 0; field_idx < descriptor->field_count(); field_idx++) {
800  if (IsLazy(descriptor->field(field_idx), options, scc_analyzer)) {
801  return true;
802  }
803  }
804  for (int idx = 0; idx < descriptor->extension_count(); idx++) {
805  if (IsLazy(descriptor->extension(idx), options, scc_analyzer)) {
806  return true;
807  }
808  }
809  for (int idx = 0; idx < descriptor->nested_type_count(); idx++) {
810  if (HasLazyFields(descriptor->nested_type(idx), options, scc_analyzer)) {
811  return true;
812  }
813  }
814  return false;
815 }
816 
817 // Does the given FileDescriptor use lazy fields?
819  MessageSCCAnalyzer* scc_analyzer) {
820  for (int i = 0; i < file->message_type_count(); i++) {
821  const Descriptor* descriptor(file->message_type(i));
822  if (HasLazyFields(descriptor, options, scc_analyzer)) {
823  return true;
824  }
825  }
826  for (int field_idx = 0; field_idx < file->extension_count(); field_idx++) {
827  if (IsLazy(file->extension(field_idx), options, scc_analyzer)) {
828  return true;
829  }
830  }
831  return false;
832 }
833 
835  for (int i = 0; i < descriptor->field_count(); ++i) {
836  if (descriptor->field(i)->label() == FieldDescriptor::LABEL_REPEATED) {
837  return true;
838  }
839  }
840  for (int i = 0; i < descriptor->nested_type_count(); ++i) {
841  if (HasRepeatedFields(descriptor->nested_type(i))) return true;
842  }
843  return false;
844 }
845 
847  for (int i = 0; i < file->message_type_count(); ++i) {
848  if (HasRepeatedFields(file->message_type(i))) return true;
849  }
850  return false;
851 }
852 
854  const Options& options) {
855  return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING &&
857 }
858 
860  const Options& options) {
861  for (int i = 0; i < descriptor->field_count(); ++i) {
862  if (IsStringPieceField(descriptor->field(i), options)) return true;
863  }
864  for (int i = 0; i < descriptor->nested_type_count(); ++i) {
865  if (HasStringPieceFields(descriptor->nested_type(i), options)) return true;
866  }
867  return false;
868 }
869 
870 bool HasStringPieceFields(const FileDescriptor* file, const Options& options) {
871  for (int i = 0; i < file->message_type_count(); ++i) {
872  if (HasStringPieceFields(file->message_type(i), options)) return true;
873  }
874  return false;
875 }
876 
877 static bool IsCordField(const FieldDescriptor* field, const Options& options) {
878  return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING &&
880 }
881 
883  const Options& options) {
884  for (int i = 0; i < descriptor->field_count(); ++i) {
885  if (IsCordField(descriptor->field(i), options)) return true;
886  }
887  for (int i = 0; i < descriptor->nested_type_count(); ++i) {
888  if (HasCordFields(descriptor->nested_type(i), options)) return true;
889  }
890  return false;
891 }
892 
893 bool HasCordFields(const FileDescriptor* file, const Options& options) {
894  for (int i = 0; i < file->message_type_count(); ++i) {
895  if (HasCordFields(file->message_type(i), options)) return true;
896  }
897  return false;
898 }
899 
901  if (descriptor->extension_range_count() > 0) return true;
902  if (descriptor->extension_count() > 0) return true;
903  for (int i = 0; i < descriptor->nested_type_count(); ++i) {
904  if (HasExtensionsOrExtendableMessage(descriptor->nested_type(i))) {
905  return true;
906  }
907  }
908  return false;
909 }
910 
912  if (file->extension_count() > 0) return true;
913  for (int i = 0; i < file->message_type_count(); ++i) {
914  if (HasExtensionsOrExtendableMessage(file->message_type(i))) return true;
915  }
916  return false;
917 }
918 
919 static bool HasMapFields(const Descriptor* descriptor) {
920  for (int i = 0; i < descriptor->field_count(); ++i) {
921  if (descriptor->field(i)->is_map()) {
922  return true;
923  }
924  }
925  for (int i = 0; i < descriptor->nested_type_count(); ++i) {
926  if (HasMapFields(descriptor->nested_type(i))) return true;
927  }
928  return false;
929 }
930 
931 bool HasMapFields(const FileDescriptor* file) {
932  for (int i = 0; i < file->message_type_count(); ++i) {
933  if (HasMapFields(file->message_type(i))) return true;
934  }
935  return false;
936 }
937 
939  if (message_type->enum_type_count() > 0) return true;
940  for (int i = 0; i < message_type->nested_type_count(); ++i) {
941  if (HasEnumDefinitions(message_type->nested_type(i))) return true;
942  }
943  return false;
944 }
945 
947  if (file->enum_type_count() > 0) return true;
948  for (int i = 0; i < file->message_type_count(); ++i) {
949  if (HasEnumDefinitions(file->message_type(i))) return true;
950  }
951  return false;
952 }
953 
955  MessageSCCAnalyzer* scc_analyzer) {
956  (void)descriptor;
957  (void)options;
958  (void)scc_analyzer;
959  return false;
960 }
961 
963  MessageSCCAnalyzer* scc_analyzer) {
964  (void)file;
965  (void)options;
966  (void)scc_analyzer;
967  return false;
968 }
969 
971  switch (field->cpp_type()) {
980  return false;
983  return true;
984  }
985 
986  GOOGLE_LOG(FATAL) << "Can't get here.";
987  return false;
988 }
989 
991  const Options& options) {
993  if (options.opensource_runtime) {
994  // Open-source protobuf release only supports STRING ctype.
995  return FieldOptions::STRING;
996  } else {
997  // Google-internal supports all ctypes.
998  return field->options().ctype();
999  }
1000 }
1001 
1002 bool IsAnyMessage(const FileDescriptor* descriptor, const Options& options) {
1003  return descriptor->name() == kAnyProtoFile;
1004 }
1005 
1006 bool IsAnyMessage(const Descriptor* descriptor, const Options& options) {
1007  return descriptor->name() == kAnyMessageName &&
1008  IsAnyMessage(descriptor->file(), options);
1009 }
1010 
1011 bool IsWellKnownMessage(const FileDescriptor* file) {
1012  static const std::unordered_set<std::string> well_known_files{
1013  "google/protobuf/any.proto",
1014  "google/protobuf/api.proto",
1015  "google/protobuf/compiler/plugin.proto",
1016  "google/protobuf/descriptor.proto",
1017  "google/protobuf/duration.proto",
1018  "google/protobuf/empty.proto",
1019  "google/protobuf/field_mask.proto",
1020  "google/protobuf/source_context.proto",
1021  "google/protobuf/struct.proto",
1022  "google/protobuf/timestamp.proto",
1023  "google/protobuf/type.proto",
1024  "google/protobuf/wrappers.proto",
1025  };
1026  return well_known_files.find(file->name()) != well_known_files.end();
1027 }
1028 
1030  const Options& options) {
1031  return true;
1032 }
1033 
1035  const Options& options) {
1036  return true;
1037 }
1038 
1039 // Which level of UTF-8 enforcemant is placed on this file.
1041  const Options& options) {
1042  if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 &&
1044  return Utf8CheckMode::kStrict;
1045  } else if (GetOptimizeFor(field->file(), options) !=
1047  FileUtf8Verification(field->file(), options)) {
1048  return Utf8CheckMode::kVerify;
1049  } else {
1050  return Utf8CheckMode::kNone;
1051  }
1052 }
1053 
1055  const Options& options, bool for_parse,
1056  const char* parameters,
1057  const char* strict_function,
1058  const char* verify_function,
1059  const Formatter& format) {
1060  switch (GetUtf8CheckMode(field, options)) {
1061  case Utf8CheckMode::kStrict: {
1062  if (for_parse) {
1063  format("DO_(");
1064  }
1065  format("::$proto_ns$::internal::WireFormatLite::$1$(\n", strict_function);
1066  format.Indent();
1067  format(parameters);
1068  if (for_parse) {
1069  format("::$proto_ns$::internal::WireFormatLite::PARSE,\n");
1070  } else {
1071  format("::$proto_ns$::internal::WireFormatLite::SERIALIZE,\n");
1072  }
1073  format("\"$1$\")", field->full_name());
1074  if (for_parse) {
1075  format(")");
1076  }
1077  format(";\n");
1078  format.Outdent();
1079  break;
1080  }
1081  case Utf8CheckMode::kVerify: {
1082  format("::$proto_ns$::internal::WireFormat::$1$(\n", verify_function);
1083  format.Indent();
1084  format(parameters);
1085  if (for_parse) {
1086  format("::$proto_ns$::internal::WireFormat::PARSE,\n");
1087  } else {
1088  format("::$proto_ns$::internal::WireFormat::SERIALIZE,\n");
1089  }
1090  format("\"$1$\");\n", field->full_name());
1091  format.Outdent();
1092  break;
1093  }
1094  case Utf8CheckMode::kNone:
1095  break;
1096  }
1097 }
1098 
1100  const Options& options, bool for_parse,
1101  const char* parameters,
1102  const Formatter& format) {
1104  "VerifyUtf8String", "VerifyUTF8StringNamedField",
1105  format);
1106 }
1107 
1109  const Options& options, bool for_parse,
1110  const char* parameters,
1111  const Formatter& format) {
1112  GenerateUtf8CheckCode(field, options, for_parse, parameters, "VerifyUtf8Cord",
1113  "VerifyUTF8CordNamedField", format);
1114 }
1115 
1117  std::vector<const Descriptor*>* result) {
1118  for (int i = 0; i < file->message_type_count(); i++) {
1119  ForEachMessage(file->message_type(i), [&](const Descriptor* descriptor) {
1120  result->push_back(descriptor);
1121  });
1122  }
1123 }
1124 
1125 bool HasWeakFields(const Descriptor* descriptor, const Options& options) {
1126  for (int i = 0; i < descriptor->field_count(); i++) {
1127  if (IsWeak(descriptor->field(i), options)) return true;
1128  }
1129  return false;
1130 }
1131 
1132 bool HasWeakFields(const FileDescriptor* file, const Options& options) {
1133  for (int i = 0; i < file->message_type_count(); ++i) {
1134  if (HasWeakFields(file->message_type(i), options)) return true;
1135  }
1136  return false;
1137 }
1138 
1140  const Options& options) {
1141  return options.lite_implicit_weak_fields &&
1143 }
1144 
1145 bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options,
1146  MessageSCCAnalyzer* scc_analyzer) {
1147  return UsingImplicitWeakFields(field->file(), options) &&
1148  field->type() == FieldDescriptor::TYPE_MESSAGE &&
1149  !field->is_required() && !field->is_map() && !field->is_extension() &&
1150  !field->real_containing_oneof() &&
1151  !IsWellKnownMessage(field->message_type()->file()) &&
1152  field->message_type()->file()->name() !=
1153  "net/proto2/proto/descriptor.proto" &&
1154  // We do not support implicit weak fields between messages in the same
1155  // strongly-connected component.
1156  scc_analyzer->GetSCC(field->containing_type()) !=
1157  scc_analyzer->GetSCC(field->message_type());
1158 }
1159 
1160 MessageAnalysis MessageSCCAnalyzer::GetSCCAnalysis(const SCC* scc) {
1161  if (analysis_cache_.count(scc)) return analysis_cache_[scc];
1162  MessageAnalysis result;
1163  if (UsingImplicitWeakFields(scc->GetFile(), options_)) {
1164  result.contains_weak = true;
1165  }
1166  for (int i = 0; i < scc->descriptors.size(); i++) {
1167  const Descriptor* descriptor = scc->descriptors[i];
1168  if (descriptor->extension_range_count() > 0) {
1169  result.contains_extension = true;
1170  }
1171  for (int j = 0; j < descriptor->field_count(); j++) {
1172  const FieldDescriptor* field = descriptor->field(j);
1173  if (field->is_required()) {
1174  result.contains_required = true;
1175  }
1176  if (field->options().weak()) {
1177  result.contains_weak = true;
1178  }
1179  switch (field->type()) {
1182  if (field->options().ctype() == FieldOptions::CORD) {
1183  result.contains_cord = true;
1184  }
1185  break;
1186  }
1189  const SCC* child = analyzer_.GetSCC(field->message_type());
1190  if (child != scc) {
1191  MessageAnalysis analysis = GetSCCAnalysis(child);
1192  result.contains_cord |= analysis.contains_cord;
1193  result.contains_extension |= analysis.contains_extension;
1195  result.contains_required |= analysis.contains_required;
1196  }
1197  result.contains_weak |= analysis.contains_weak;
1198  } else {
1199  // This field points back into the same SCC hence the messages
1200  // in the SCC are recursive. Note if SCC contains more than two
1201  // nodes it has to be recursive, however this test also works for
1202  // a single node that is recursive.
1203  result.is_recursive = true;
1204  }
1205  break;
1206  }
1207  default:
1208  break;
1209  }
1210  }
1211  }
1212  // We deliberately only insert the result here. After we contracted the SCC
1213  // in the graph, the graph should be a DAG. Hence we shouldn't need to mark
1214  // nodes visited as we can never return to them. By inserting them here
1215  // we will go in an infinite loop if the SCC is not correct.
1216  return analysis_cache_[scc] = result;
1217 }
1218 
1219 void ListAllFields(const Descriptor* d,
1220  std::vector<const FieldDescriptor*>* fields) {
1221  // Collect sub messages
1222  for (int i = 0; i < d->nested_type_count(); i++) {
1223  ListAllFields(d->nested_type(i), fields);
1224  }
1225  // Collect message level extensions.
1226  for (int i = 0; i < d->extension_count(); i++) {
1227  fields->push_back(d->extension(i));
1228  }
1229  // Add types of fields necessary
1230  for (int i = 0; i < d->field_count(); i++) {
1231  fields->push_back(d->field(i));
1232  }
1233 }
1234 
1235 void ListAllFields(const FileDescriptor* d,
1236  std::vector<const FieldDescriptor*>* fields) {
1237  // Collect file level message.
1238  for (int i = 0; i < d->message_type_count(); i++) {
1239  ListAllFields(d->message_type(i), fields);
1240  }
1241  // Collect message level extensions.
1242  for (int i = 0; i < d->extension_count(); i++) {
1243  fields->push_back(d->extension(i));
1244  }
1245 }
1246 
1248  std::vector<const Descriptor*>* types) {
1249  for (int i = 0; i < fd->service_count(); i++) {
1250  const ServiceDescriptor* sd = fd->service(i);
1251  for (int j = 0; j < sd->method_count(); j++) {
1252  const MethodDescriptor* method = sd->method(j);
1253  types->push_back(method->input_type());
1254  types->push_back(method->output_type());
1255  }
1256  }
1257 }
1258 
1259 bool GetBootstrapBasename(const Options& options, const std::string& basename,
1260  std::string* bootstrap_basename) {
1261  if (options.opensource_runtime) {
1262  return false;
1263  }
1264 
1265  std::unordered_map<std::string, std::string> bootstrap_mapping{
1266  {"net/proto2/proto/descriptor",
1267  "net/proto2/internal/descriptor"},
1268  {"net/proto2/compiler/proto/plugin",
1269  "net/proto2/compiler/proto/plugin"},
1270  {"net/proto2/compiler/proto/profile",
1271  "net/proto2/compiler/proto/profile_bootstrap"},
1272  };
1273  auto iter = bootstrap_mapping.find(basename);
1274  if (iter == bootstrap_mapping.end()) {
1275  *bootstrap_basename = basename;
1276  return false;
1277  } else {
1278  *bootstrap_basename = iter->second;
1279  return true;
1280  }
1281 }
1282 
1283 bool IsBootstrapProto(const Options& options, const FileDescriptor* file) {
1284  std::string my_name = StripProto(file->name());
1285  return GetBootstrapBasename(options, my_name, &my_name);
1286 }
1287 
1288 bool MaybeBootstrap(const Options& options, GeneratorContext* generator_context,
1289  bool bootstrap_flag, std::string* basename) {
1290  std::string bootstrap_basename;
1291  if (!GetBootstrapBasename(options, *basename, &bootstrap_basename)) {
1292  return false;
1293  }
1294 
1295  if (bootstrap_flag) {
1296  // Adjust basename, but don't abort code generation.
1297  *basename = bootstrap_basename;
1298  return false;
1299  } else {
1300  std::string forward_to_basename = bootstrap_basename;
1301 
1302  // Generate forwarding headers and empty .pb.cc.
1303  {
1304  std::unique_ptr<io::ZeroCopyOutputStream> output(
1305  generator_context->Open(*basename + ".pb.h"));
1306  io::Printer printer(output.get(), '$', nullptr);
1307  printer.Print(
1308  "#ifndef PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n"
1309  "#define PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n"
1310  "#include \"$forward_to_basename$.pb.h\" // IWYU pragma: export\n"
1311  "#endif // PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n",
1312  "forward_to_basename", forward_to_basename, "filename_identifier",
1313  FilenameIdentifier(*basename));
1314 
1315  if (!options.opensource_runtime) {
1316  // HACK HACK HACK, tech debt from the deeps of proto1 and SWIG
1317  // protocoltype is SWIG'ed and we need to forward
1318  if (*basename == "net/proto/protocoltype") {
1319  printer.Print(
1320  "#ifdef SWIG\n"
1321  "%include \"$forward_to_basename$.pb.h\"\n"
1322  "#endif // SWIG\n",
1323  "forward_to_basename", forward_to_basename);
1324  }
1325  }
1326  }
1327 
1328  {
1329  std::unique_ptr<io::ZeroCopyOutputStream> output(
1330  generator_context->Open(*basename + ".proto.h"));
1331  io::Printer printer(output.get(), '$', nullptr);
1332  printer.Print(
1333  "#ifndef PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n"
1334  "#define PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n"
1335  "#include \"$forward_to_basename$.proto.h\" // IWYU pragma: "
1336  "export\n"
1337  "#endif // "
1338  "PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n",
1339  "forward_to_basename", forward_to_basename, "filename_identifier",
1340  FilenameIdentifier(*basename));
1341  }
1342 
1343  {
1344  std::unique_ptr<io::ZeroCopyOutputStream> output(
1345  generator_context->Open(*basename + ".pb.cc"));
1346  io::Printer printer(output.get(), '$', nullptr);
1347  printer.Print("\n");
1348  }
1349 
1350  {
1351  std::unique_ptr<io::ZeroCopyOutputStream> output(
1352  generator_context->Open(*basename + ".pb.h.meta"));
1353  }
1354 
1355  {
1356  std::unique_ptr<io::ZeroCopyOutputStream> output(
1357  generator_context->Open(*basename + ".proto.h.meta"));
1358  }
1359 
1360  // Abort code generation.
1361  return true;
1362  }
1363 }
1364 
1366  const Options& options,
1367  bool* has_opt_codesize_extension) {
1368  std::vector<const FieldDescriptor*> fields;
1369  auto reflection = msg.GetReflection();
1370  reflection->ListFields(msg, &fields);
1371  for (auto field : fields) {
1372  const auto* field_msg = field->message_type();
1373  if (field_msg == nullptr) {
1374  // It so happens that enums Is_Valid are still generated so enums work.
1375  // Only messages have potential problems.
1376  continue;
1377  }
1378  // If this option has an extension set AND that extension is defined in the
1379  // same file we have bootstrap problem.
1380  if (field->is_extension()) {
1381  const auto* msg_extension_file = field->message_type()->file();
1382  if (msg_extension_file == file) return true;
1383  if (has_opt_codesize_extension &&
1384  GetOptimizeFor(msg_extension_file, options) ==
1386  *has_opt_codesize_extension = true;
1387  }
1388  }
1389  // Recurse in this field to see if there is a problem in there
1390  if (field->is_repeated()) {
1391  for (int i = 0; i < reflection->FieldSize(msg, field); i++) {
1392  if (HasExtensionFromFile(reflection->GetRepeatedMessage(msg, field, i),
1393  file, options, has_opt_codesize_extension)) {
1394  return true;
1395  }
1396  }
1397  } else {
1398  if (HasExtensionFromFile(reflection->GetMessage(msg, field), file,
1399  options, has_opt_codesize_extension)) {
1400  return true;
1401  }
1402  }
1403  }
1404  return false;
1405 }
1406 
1408  const Options& options,
1409  bool* has_opt_codesize_extension) {
1410  static auto& cache = *new std::unordered_map<const FileDescriptor*, bool>;
1411  auto it = cache.find(file);
1412  if (it != cache.end()) return it->second;
1413  // In order to build the data structures for the reflective parse, it needs
1414  // to parse the serialized descriptor describing all the messages defined in
1415  // this file. Obviously this presents a bootstrap problem for descriptor
1416  // messages.
1417  if (file->name() == "net/proto2/proto/descriptor.proto" ||
1418  file->name() == "google/protobuf/descriptor.proto") {
1419  return true;
1420  }
1421  // Unfortunately we're not done yet. The descriptor option messages allow
1422  // for extensions. So we need to be able to parse these extensions in order
1423  // to parse the file descriptor for a file that has custom options. This is a
1424  // problem when these custom options extensions are defined in the same file.
1425  FileDescriptorProto linkedin_fd_proto;
1426  const DescriptorPool* pool = file->pool();
1427  const Descriptor* fd_proto_descriptor =
1428  pool->FindMessageTypeByName(linkedin_fd_proto.GetTypeName());
1429  // Not all pools have descriptor.proto in them. In these cases there for sure
1430  // are no custom options.
1431  if (fd_proto_descriptor == nullptr) return false;
1432 
1433  // It's easier to inspect file as a proto, because we can use reflection on
1434  // the proto to iterate over all content.
1435  file->CopyTo(&linkedin_fd_proto);
1436 
1437  // linkedin_fd_proto is a generated proto linked in the proto compiler. As
1438  // such it doesn't know the extensions that are potentially present in the
1439  // descriptor pool constructed from the protos that are being compiled. These
1440  // custom options are therefore in the unknown fields.
1441  // By building the corresponding FileDescriptorProto in the pool constructed
1442  // by the protos that are being compiled, ie. file's pool, the unknown fields
1443  // are converted to extensions.
1444  DynamicMessageFactory factory(pool);
1445  Message* fd_proto = factory.GetPrototype(fd_proto_descriptor)->New();
1446  fd_proto->ParseFromString(linkedin_fd_proto.SerializeAsString());
1447 
1448  bool& res = cache[file];
1449  res = HasExtensionFromFile(*fd_proto, file, options,
1450  has_opt_codesize_extension);
1451  delete fd_proto;
1452  return res;
1453 }
1454 
1456  const Options& options,
1457  bool* has_opt_codesize_extension) {
1458  if (has_opt_codesize_extension) *has_opt_codesize_extension = false;
1459  switch (options.enforce_mode) {
1461  return FileOptions::SPEED;
1465  if (file->options().optimize_for() == FileOptions::LITE_RUNTIME) {
1467  }
1468  if (HasBootstrapProblem(file, options, has_opt_codesize_extension)) {
1469  return FileOptions::SPEED;
1470  }
1471  return FileOptions::CODE_SIZE;
1473  if (file->options().optimize_for() == FileOptions::CODE_SIZE) {
1474  if (HasBootstrapProblem(file, options, has_opt_codesize_extension)) {
1475  GOOGLE_LOG(WARNING) << "Proto states optimize_for = CODE_SIZE, but we "
1476  "cannot honor that because it contains custom option "
1477  "extensions defined in the same proto.";
1478  return FileOptions::SPEED;
1479  }
1480  }
1481  return file->options().optimize_for();
1482  }
1483 
1484  GOOGLE_LOG(FATAL) << "Unknown optimization enforcement requested.";
1485  // The phony return below serves to silence a warning from GCC 8.
1486  return FileOptions::SPEED;
1487 }
1488 
1490  (void)desc;
1491  return false;
1492 }
1493 
1494 } // namespace cpp
1495 } // namespace compiler
1496 } // namespace protobuf
1497 } // namespace google
google::protobuf::FieldDescriptor::Type
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:521
google::protobuf::compiler::cpp::IsBootstrapProto
bool IsBootstrapProto(const Options &options, const FileDescriptor *file)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1268
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf::compiler::cpp::EnforceOptimizeMode::kLiteRuntime
@ kLiteRuntime
google::protobuf::compiler::cpp::IsAnyMessage
bool IsAnyMessage(const FileDescriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:959
filename
const char * filename
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
regen-readme.it
it
Definition: regen-readme.py:15
http2_test_server.format
format
Definition: http2_test_server.py:118
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::compiler::cpp::DefaultInstancePtr
std::string DefaultInstancePtr(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:377
google::protobuf::compiler::cpp::IsStringOrMessage
bool IsStringOrMessage(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:927
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
absl::str_format_internal::LengthMod::j
@ j
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
file
const grpc_generator::File * file
Definition: python_private_generator.h:38
google::protobuf::FieldDescriptor::TYPE_SFIXED64
@ TYPE_SFIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:542
google::protobuf::compiler::cpp::FieldName
std::string FieldName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:416
google::protobuf::compiler::cpp::ProtobufNamespace
std::string ProtobufNamespace(const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:60
google::protobuf::compiler::cpp::StripProto
std::string StripProto(const std::string &filename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:480
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf.internal._parameterized.parameters
def parameters(*testcases)
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py:315
phone_pb2.message_type
message_type
Definition: phone_pb2.py:200
options
double_dict options[]
Definition: capstone_test.c:55
FileOptions_OptimizeMode
FileOptions_OptimizeMode
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:235
google::protobuf::compiler::cpp::FieldConstantName
std::string FieldConstantName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:457
google::protobuf::compiler::cpp::GenerateUtf8CheckCode
static void GenerateUtf8CheckCode(const FieldDescriptor *field, const Options &options, bool for_parse, const char *parameters, const char *strict_function, const char *verify_function, const Formatter &format)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1030
google::protobuf::compiler::cpp::ForEachMessage
void ForEachMessage(const Descriptor *descriptor, F &&func)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:544
google::protobuf::compiler::cpp::HasEnumDefinitions
static bool HasEnumDefinitions(const Descriptor *message_type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:911
google::protobuf::compiler::cpp::HasLazyFields
static bool HasLazyFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:771
FileDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:128
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::FieldDescriptor::TYPE_BYTES
@ TYPE_BYTES
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:538
google::protobuf::compiler::cpp::Utf8CheckMode::kVerify
@ kVerify
google::protobuf::FieldDescriptor::TYPE_DOUBLE
@ TYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:522
file
Definition: bloaty/third_party/zlib/examples/gzappend.c:170
google::protobuf::CEscape
string CEscape(const string &src)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:615
grpc::protobuf::io::Printer
GRPC_CUSTOM_PRINTER Printer
Definition: src/compiler/config.h:54
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::FieldDescriptor::TYPE_BOOL
@ TYPE_BOOL
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:533
google::protobuf::compiler::cpp::QualifiedClassName
std::string QualifiedClassName(const Descriptor *d, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:320
setup.name
name
Definition: setup.py:542
google::protobuf::compiler::cpp::IsStringInlined
bool IsStringInlined(const FieldDescriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:752
google::protobuf::compiler::cpp::SuperClassName
std::string SuperClassName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:402
google::protobuf::compiler::cpp::UInt64ToString
std::string UInt64ToString(const std::string &macro_prefix, uint64 number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:618
google::protobuf::compiler::cpp::EstimateAlignmentSize
int EstimateAlignmentSize(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:433
grpc_cpp_generator::DotsToColons
std::string DotsToColons(const std::string &name)
Definition: cpp_generator_helpers.h:29
google::protobuf::FieldDescriptor::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:535
google::protobuf::compiler::cpp::SetUnknownFieldsVariable
void SetUnknownFieldsVariable(const Descriptor *descriptor, const Options &options, std::map< std::string, std::string > *variables)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:232
google::protobuf::compiler::cpp::EnumValueName
std::string EnumValueName(const EnumValueDescriptor *enum_value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:425
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf::FieldDescriptor::TYPE_INT64
@ TYPE_INT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:524
google::protobuf::compiler::cpp::UniqueName
string UniqueName(const std::string &name, const std::string &filename, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:712
google::protobuf::compiler::cpp::GetOptimizeFor
FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:473
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1482
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
google::protobuf::compiler::cpp::FileUtf8Verification
static bool FileUtf8Verification(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:997
google::protobuf::compiler::cpp::DeclaredTypeMethodName
const char * DeclaredTypeMethodName(FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:551
google::protobuf::compiler::cpp::FieldEnforceUtf8
static bool FieldEnforceUtf8(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:992
FieldOptions::CORD
static constexpr CType CORD
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4723
google::protobuf::compiler::cpp::HasMapFields
static bool HasMapFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:892
google::protobuf::compiler::cpp::FlattenMessagesInFile
void FlattenMessagesInFile(const FileDescriptor *file, std::vector< const Descriptor * > *result)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1103
google::protobuf::compiler::cpp::IsWeak
bool IsWeak(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:300
google::protobuf::EnumValueDescriptor::name
const std::string & name() const
google::protobuf::compiler::cpp::HasWeakFields
bool HasWeakFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1110
google::protobuf::FileDescriptor::SYNTAX_PROTO3
@ SYNTAX_PROTO3
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1394
google::protobuf::compiler::cpp::GenerateUtf8CheckCodeForString
void GenerateUtf8CheckCodeForString(const FieldDescriptor *field, const Options &options, bool for_parse, const char *parameters, const Formatter &format)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1075
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::compiler::cpp::IsStringPieceField
static bool IsStringPieceField(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:826
google::protobuf::FieldDescriptor::TYPE_ENUM
@ TYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:540
grpc::protobuf::compiler::GeneratorContext
GRPC_CUSTOM_GENERATORCONTEXT GeneratorContext
Definition: src/compiler/config.h:42
google::protobuf::compiler::cpp::FileDllExport
std::string FileDllExport(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:398
google::protobuf::compiler::cpp::HasStringPieceFields
static bool HasStringPieceFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:832
google::protobuf::compiler::cpp::UsingImplicitWeakFields
bool UsingImplicitWeakFields(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1124
google::protobuf::compiler::cpp::ExtensionName
std::string ExtensionName(const FieldDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:347
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
google::protobuf::compiler::cpp::SafeFunctionName
std::string SafeFunctionName(const Descriptor *descriptor, const FieldDescriptor *field, const std::string &prefix)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:733
google::protobuf::compiler::cpp::QualifiedDefaultInstancePtr
std::string QualifiedDefaultInstancePtr(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:388
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
google::protobuf::compiler::cpp::EnforceOptimizeMode::kCodeSize
@ kCodeSize
google::protobuf::compiler::cpp::EffectiveStringCType
FieldOptions::CType EffectiveStringCType(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:947
google::protobuf::FieldDescriptor::TYPE_FIXED32
@ TYPE_FIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:532
google::protobuf::compiler::cpp::SimpleBaseClass
std::string SimpleBaseClass(const Descriptor *desc, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:671
google::protobuf::compiler::cpp::IsLazy
bool IsLazy(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:330
google::protobuf::compiler::cpp::IsLazilyVerifiedLazy
bool IsLazilyVerifiedLazy(const FieldDescriptor *field, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:351
google::protobuf::compiler::cpp::ResolveKeyword
std::string ResolveKeyword(const string &name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:409
grpc::protobuf::MethodDescriptor
GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:87
google::protobuf::compiler::cpp::IsImplicitWeakField
bool IsImplicitWeakField(const FieldDescriptor *field, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1130
google::protobuf::compiler::cpp::QualifiedFileLevelSymbol
std::string QualifiedFileLevelSymbol(const FileDescriptor *file, const std::string &name, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:718
google::protobuf::SimpleFtoa
string SimpleFtoa(float value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1226
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf::compiler::cpp::IsMapEntryMessage
bool IsMapEntryMessage(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:398
google::protobuf::DescriptorPool
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1539
google::protobuf::compiler::cpp::FieldMessageTypeName
std::string FieldMessageTypeName(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:473
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
FileOptions::LITE_RUNTIME
static constexpr OptimizeMode LITE_RUNTIME
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3831
google::protobuf::compiler::cpp::DefaultInstanceType
std::string DefaultInstanceType(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:367
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
FileOptions::SPEED
static constexpr OptimizeMode SPEED
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3827
google::protobuf::FieldDescriptor::LABEL_REPEATED
@ LABEL_REPEATED
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:574
google::protobuf::compiler::cpp::DescriptorTableName
std::string DescriptorTableName(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:393
google::protobuf::compiler::cpp::MessageSCCAnalyzer::options_
Options options_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:546
FieldOptions::STRING_PIECE
static constexpr CType STRING_PIECE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4725
google::protobuf::compiler::cpp::DefaultValue
std::string DefaultValue(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:622
google::protobuf::WARNING
static const LogLevel WARNING
Definition: bloaty/third_party/protobuf/src/google/protobuf/testing/googletest.h:71
google::protobuf::compiler::cpp::UseUnknownFieldSet
bool UseUnknownFieldSet(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:295
google::protobuf::strings::Substitute
string Substitute(const char *format, const SubstituteArg &arg0, const SubstituteArg &arg1, const SubstituteArg &arg2, const SubstituteArg &arg3, const SubstituteArg &arg4, const SubstituteArg &arg5, const SubstituteArg &arg6, const SubstituteArg &arg7, const SubstituteArg &arg8, const SubstituteArg &arg9)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/substitute.cc:55
cpp
Definition: third_party/bloaty/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py:1
google::protobuf::FieldDescriptor::CPPTYPE_UINT64
@ CPPTYPE_UINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:557
google::protobuf::compiler::cpp::SetCommonVars
void SetCommonVars(const Options &options, std::map< std::string, std::string > *variables)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:210
min
#define min(a, b)
Definition: qsort.h:83
FileDescriptorProto
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:501
google::protobuf::compiler::cpp::Options
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h:52
google::protobuf::compiler::cpp::GetBootstrapBasename
bool GetBootstrapBasename(const Options &options, const std::string &basename, std::string *bootstrap_basename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1244
google::protobuf::compiler::cpp::QualifiedDefaultInstanceName
std::string QualifiedDefaultInstanceName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:382
EnumDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:143
google::protobuf::compiler::cpp::HasDescriptorMethods
bool HasDescriptorMethods(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:368
google::protobuf::compiler::cpp::ListAllFields
void ListAllFields(const Descriptor *d, std::vector< const FieldDescriptor * > *fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1204
google::protobuf::compiler::cpp::Utf8CheckMode::kNone
@ kNone
setup.idx
idx
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:197
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google::protobuf::LowerString
void LowerString(string *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:177
FieldOptions::STRING
static constexpr CType STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4721
google::protobuf::compiler::cpp::HasBootstrapProblem
static bool HasBootstrapProblem(const FileDescriptor *file, const Options &options, bool *has_opt_codesize_extension)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1407
google::protobuf::compiler::cpp::HasCordFields
static bool HasCordFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:855
google::protobuf::compiler::cpp::kThickSeparator
const char kThickSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:273
google::protobuf::compiler::cpp::Int32ToString
std::string Int32ToString(int number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:599
google::protobuf::FieldDescriptor::CPPTYPE_INT64
@ CPPTYPE_INT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:555
google::protobuf::DynamicMessageFactory
Definition: bloaty/third_party/protobuf/src/google/protobuf/dynamic_message.h:80
google::protobuf::FieldDescriptor::TYPE_SINT32
@ TYPE_SINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:543
google::protobuf::compiler::cpp::HasExtensionFromFile
static bool HasExtensionFromFile(const Message &msg, const FileDescriptor *file, const Options &options, bool *has_opt_codesize_extension)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1365
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf::compiler::cpp::Namespace
std::string Namespace(const std::string &package)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:337
google::protobuf::compiler::cpp::IsWellKnownMessage
bool IsWellKnownMessage(const FileDescriptor *file)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:968
google::protobuf::compiler::cpp::Utf8CheckMode
Utf8CheckMode
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:986
google::protobuf::SimpleDtoa
string SimpleDtoa(double value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1221
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
google::protobuf::FieldDescriptor::CPPTYPE_UINT32
@ CPPTYPE_UINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:556
google::protobuf::compiler::cpp::OneofCaseConstantName
std::string OneofCaseConstantName(const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:456
google::protobuf::FieldDescriptor::CPPTYPE_FLOAT
@ CPPTYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:559
google::protobuf::FieldDescriptor::TYPE_SINT64
@ TYPE_SINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:544
google::protobuf::StringReplace
void StringReplace(const string &s, const string &oldsub, const string &newsub, bool replace_all, string *res)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:148
google::protobuf::FieldDescriptor::TYPE_FLOAT
@ TYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:523
FieldOptions_CType
FieldOptions_CType
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:259
google::protobuf::compiler::cpp::EnableMessageOwnedArena
bool EnableMessageOwnedArena(const Descriptor *desc)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1489
google::protobuf::FieldDescriptor::TYPE_SFIXED32
@ TYPE_SFIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:541
google::protobuf::compiler::cpp::MessageSCCAnalyzer::GetSCCAnalysis
MessageAnalysis GetSCCAnalysis(const SCC *scc)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1145
google::protobuf::compiler::cpp::FilenameIdentifier
std::string FilenameIdentifier(const std::string &filename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:698
google::protobuf::compiler::cpp::MessageSCCAnalyzer
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:519
google::protobuf::compiler::cpp::DefaultInstanceName
std::string DefaultInstanceName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:372
google::protobuf::FieldDescriptor::CPPTYPE_BOOL
@ CPPTYPE_BOOL
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:560
google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE
@ CPPTYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:558
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
google::protobuf::compiler::StripProto
std::string StripProto(const std::string &filename)
Definition: protobuf/src/google/protobuf/compiler/code_generator.cc:127
google::protobuf::compiler::cpp::GenerateUtf8CheckCodeForCord
void GenerateUtf8CheckCodeForCord(const FieldDescriptor *field, const Options &options, bool for_parse, const char *parameters, const Formatter &format)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1084
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
google::protobuf::compiler::cpp::HasExtensionsOrExtendableMessage
static bool HasExtensionsOrExtendableMessage(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:873
google::protobuf::compiler::cpp::EscapeTrigraphs
std::string EscapeTrigraphs(const std::string &to_escape)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:728
google::protobuf::compiler::cpp::MessageSCCAnalyzer::analyzer_
SCCAnalyzer< DepsGenerator > analyzer_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:545
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:561
google::protobuf::compiler::cpp::QualifiedExtensionName
std::string QualifiedExtensionName(const FieldDescriptor *d, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:353
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
google::protobuf::MessageLite::ParseFromString
bool ParseFromString(const std::string &data)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.cc:284
google::protobuf::compiler::cpp::EnforceOptimizeMode::kNoEnforcement
@ kNoEnforcement
google::protobuf::EnumValueDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1075
google::protobuf::compiler::cpp::ClassName
std::string ClassName(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:302
google::protobuf::compiler::cpp::HasRepeatedFields
static bool HasRepeatedFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:807
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::FieldDescriptor::TYPE_MESSAGE
@ TYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:536
desc
#define desc
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:338
google::protobuf::compiler::cpp::EnforceOptimizeMode::kSpeed
@ kSpeed
types
static const struct nv types[]
Definition: adig.c:83
google::protobuf::FieldDescriptor::TYPE_UINT32
@ TYPE_UINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:539
google::protobuf::compiler::cpp::UnderscoresToCamelCase
std::string UnderscoresToCamelCase(const std::string &input, bool cap_next_letter)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:247
google::protobuf::compiler::cpp::PrimitiveTypeName
const char * PrimitiveTypeName(FieldDescriptor::CppType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:488
google::protobuf::Message::New
Message * New() const override=0
google::protobuf::ascii_isalnum
bool ascii_isalnum(char c)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:67
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::compiler::cpp::ListAllTypesForServices
void ListAllTypesForServices(const FileDescriptor *fd, std::vector< const Descriptor * > *types)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1232
google::protobuf::FieldDescriptor::TYPE_FIXED64
@ TYPE_FIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:531
pool
InternalDescriptorPool * pool
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:807
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::compiler::cpp::ShouldIgnoreRequiredFieldCheck
static bool ShouldIgnoreRequiredFieldCheck(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:501
google::protobuf::compiler::cpp::GetUtf8CheckMode
static Utf8CheckMode GetUtf8CheckMode(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1003
iter
Definition: test_winkernel.cpp:47
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
make_curve25519_tables.d
int d
Definition: make_curve25519_tables.py:53
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf::FieldDescriptor::TYPE_INT32
@ TYPE_INT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:528
google::protobuf::compiler::cpp::MessageSCCAnalyzer::analysis_cache_
std::map< const SCC *, MessageAnalysis > analysis_cache_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:547
google::protobuf::compiler::cpp::Utf8CheckMode::kStrict
@ kStrict
google::protobuf::compiler::cpp::kThinSeparator
const char kThinSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:275
file::name
char * name
Definition: bloaty/third_party/zlib/examples/gzappend.c:176
enum_descriptor
VALUE enum_descriptor(VALUE self)
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/message.c:794
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
google::protobuf::compiler::cpp::ShouldVerify
bool ShouldVerify(const Descriptor *descriptor, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:954
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::FieldDescriptor::TYPE_STRING
@ TYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:534
grpc::protobuf::ServiceDescriptor
GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:88
google::protobuf::compiler::cpp::CanInitializeByZeroing
bool CanInitializeByZeroing(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:278
google::protobuf::compiler::cpp::Int64ToString
std::string Int64ToString(const std::string &macro_prefix, int64 number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:609
google::protobuf::FieldDescriptor::CppType
CppType
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:553
compiler
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc:21
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::compiler::cpp::QualifiedOneofCaseConstantName
std::string QualifiedOneofCaseConstantName(const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:462
google::protobuf::compiler::cpp::Formatter
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:637
google::protobuf::DynamicMessageFactory::GetPrototype
const Message * GetPrototype(const Descriptor *type) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/dynamic_message.cc:653
FileOptions::CODE_SIZE
static constexpr OptimizeMode CODE_SIZE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3829
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::method
const Descriptor::ReservedRange const EnumValueDescriptor method
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1973
google::protobuf::compiler::cpp::IsCordField
static bool IsCordField(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:850
google::protobuf::FieldDescriptor::TYPE_UINT64
@ TYPE_UINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:527
framework.helpers.highlighter.Formatter
Formatter
Definition: highlighter.py:53
google::protobuf::compiler::cpp::MaybeBootstrap
bool MaybeBootstrap(const Options &options, GeneratorContext *generator_context, bool bootstrap_flag, std::string *basename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1273
google::protobuf::FieldDescriptor::CPPTYPE_INT32
@ CPPTYPE_INT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:554
google::protobuf::StrAppend
void StrAppend(string *result, const AlphaNum &a)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1583
cpp_names.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:05