protobuf/src/google/protobuf/compiler/cpp/cpp_field.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_field.h>
36 
37 #include <cstdint>
38 #include <memory>
39 #include <string>
40 
41 #include <google/protobuf/compiler/cpp/cpp_helpers.h>
42 #include <google/protobuf/compiler/cpp/cpp_primitive_field.h>
43 #include <google/protobuf/compiler/cpp/cpp_string_field.h>
44 #include <google/protobuf/stubs/strutil.h>
45 #include <google/protobuf/stubs/substitute.h>
46 #include <google/protobuf/stubs/logging.h>
47 #include <google/protobuf/stubs/common.h>
48 #include <google/protobuf/compiler/cpp/cpp_enum_field.h>
49 #include <google/protobuf/compiler/cpp/cpp_map_field.h>
50 #include <google/protobuf/compiler/cpp/cpp_message_field.h>
51 #include <google/protobuf/descriptor.pb.h>
52 #include <google/protobuf/io/printer.h>
53 #include <google/protobuf/wire_format.h>
54 
55 namespace google {
56 namespace protobuf {
57 namespace compiler {
58 namespace cpp {
59 
60 using internal::WireFormat;
61 
62 namespace {
63 
64 void MaySetAnnotationVariable(const Options& options,
65  StringPiece annotation_name,
66  StringPiece substitute_template_prefix,
67  StringPiece prepared_template,
68  int field_index, StringPiece access_type,
69  std::map<std::string, std::string>* variables) {
70  if (options.field_listener_options.forbidden_field_listener_events.count(
71  std::string(annotation_name)))
72  return;
73  (*variables)[StrCat("annotate_", annotation_name)] = strings::Substitute(
74  StrCat(substitute_template_prefix, prepared_template, ");\n"),
75  field_index, access_type);
76 }
77 
78 std::string GenerateTemplateForOneofString(const FieldDescriptor* descriptor,
79  StringPiece proto_ns,
80  StringPiece field_member) {
82  std::string field_pointer =
83  descriptor->options().ctype() == google::protobuf::FieldOptions::STRING
84  ? "$0.GetPointer()"
85  : "$0";
86 
87  if (descriptor->default_value_string().empty()) {
88  return strings::Substitute(StrCat("_internal_has_", field_name, "() ? ",
89  field_pointer, ": nullptr"),
90  field_member);
91  }
92 
93  if (descriptor->options().ctype() == google::protobuf::FieldOptions::STRING_PIECE) {
94  return strings::Substitute(StrCat("_internal_has_", field_name, "() ? ",
95  field_pointer, ": nullptr"),
96  field_member);
97  }
98 
99  std::string default_value_pointer =
100  descriptor->options().ctype() == google::protobuf::FieldOptions::STRING
101  ? "&$1.get()"
102  : "&$1";
103  return strings::Substitute(
104  StrCat("_internal_has_", field_name, "() ? ", field_pointer, " : ",
105  default_value_pointer),
106  field_member, MakeDefaultName(descriptor));
107 }
108 
109 std::string GenerateTemplateForSingleString(const FieldDescriptor* descriptor,
110  StringPiece field_member) {
111  if (descriptor->default_value_string().empty()) {
112  return StrCat("&", field_member);
113  }
114 
115  if (descriptor->options().ctype() == google::protobuf::FieldOptions::STRING) {
116  return strings::Substitute(
117  "$0.IsDefault(nullptr) ? &$1.get() : $0.GetPointer()", field_member,
119  }
120 
121  return StrCat("&", field_member);
122 }
123 
124 } // namespace
125 
127  const Options& options,
128  std::map<std::string, std::string>* variables) {
129  // Can be expanded to include more specific calls, for example, for arena or
130  // clear calls.
131  static constexpr const char* kAccessorsAnnotations[] = {
132  "annotate_add", "annotate_get", "annotate_has",
133  "annotate_list", "annotate_mutable", "annotate_mutable_list",
134  "annotate_release", "annotate_set", "annotate_size",
135  "annotate_clear", "annotate_add_mutable",
136  };
137  for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kAccessorsAnnotations); ++i) {
138  (*variables)[kAccessorsAnnotations[i]] = "";
139  }
140  if (options.annotate_accessor) {
141  for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kAccessorsAnnotations); ++i) {
142  (*variables)[kAccessorsAnnotations[i]] = StrCat(
143  " ", FieldName(descriptor), "_AccessedNoStrip = true;\n");
144  }
145  }
146  if (!options.field_listener_options.inject_field_listener_events) {
147  return;
148  }
149  if (descriptor->file()->options().optimize_for() ==
150  google::protobuf::FileOptions::LITE_RUNTIME) {
151  return;
152  }
153  std::string field_member = (*variables)["field_member"];
154  const google::protobuf::OneofDescriptor* oneof_member =
155  descriptor->real_containing_oneof();
156  if (oneof_member) {
157  field_member = StrCat(oneof_member->name(), "_.", field_member);
158  }
159  const std::string proto_ns = (*variables)["proto_ns"];
160  const std::string substitute_template_prefix = " _tracker_.$1<$0>(this, ";
161  std::string prepared_template;
162 
163  // Flat template is needed if the prepared one is introspecting the values
164  // inside the returned values, for example, for repeated fields and maps.
165  std::string prepared_flat_template;
166  std::string prepared_add_template;
167  // TODO(b/190614678): Support fields with type Message or Map.
168  if (descriptor->is_repeated() && !descriptor->is_map()) {
169  if (descriptor->type() != FieldDescriptor::TYPE_MESSAGE &&
171  prepared_template = strings::Substitute("&$0.Get(index)", field_member);
172  prepared_add_template =
173  strings::Substitute("&$0.Get($0.size() - 1)", field_member);
174  } else {
175  prepared_template = "nullptr";
176  prepared_add_template = "nullptr";
177  }
178  } else if (descriptor->is_map()) {
179  prepared_template = "nullptr";
180  } else if (descriptor->type() == FieldDescriptor::TYPE_MESSAGE &&
181  !descriptor->options().lazy()) {
182  prepared_template = "nullptr";
183  } else if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_STRING) {
184  if (oneof_member) {
185  prepared_template = GenerateTemplateForOneofString(
186  descriptor, (*variables)["proto_ns"], field_member);
187  } else {
188  prepared_template =
189  GenerateTemplateForSingleString(descriptor, field_member);
190  }
191  } else {
192  prepared_template = StrCat("&", field_member);
193  }
194  if (descriptor->is_repeated() && !descriptor->is_map() &&
197  prepared_flat_template = StrCat("&", field_member);
198  } else {
199  prepared_flat_template = prepared_template;
200  }
201 
202  MaySetAnnotationVariable(options, "get", substitute_template_prefix,
203  prepared_template, descriptor->index(), "OnGet",
204  variables);
205  MaySetAnnotationVariable(options, "set", substitute_template_prefix,
206  prepared_template, descriptor->index(), "OnSet",
207  variables);
208  MaySetAnnotationVariable(options, "has", substitute_template_prefix,
209  prepared_template, descriptor->index(), "OnHas",
210  variables);
211  MaySetAnnotationVariable(options, "mutable", substitute_template_prefix,
212  prepared_template, descriptor->index(), "OnMutable",
213  variables);
214  MaySetAnnotationVariable(options, "release", substitute_template_prefix,
215  prepared_template, descriptor->index(), "OnRelease",
216  variables);
217  MaySetAnnotationVariable(options, "clear", substitute_template_prefix,
218  prepared_flat_template, descriptor->index(),
219  "OnClear", variables);
220  MaySetAnnotationVariable(options, "size", substitute_template_prefix,
221  prepared_flat_template, descriptor->index(),
222  "OnSize", variables);
223  MaySetAnnotationVariable(options, "list", substitute_template_prefix,
224  prepared_flat_template, descriptor->index(),
225  "OnList", variables);
226  MaySetAnnotationVariable(options, "mutable_list", substitute_template_prefix,
227  prepared_flat_template, descriptor->index(),
228  "OnMutableList", variables);
229  MaySetAnnotationVariable(options, "add", substitute_template_prefix,
230  prepared_add_template, descriptor->index(), "OnAdd",
231  variables);
232  MaySetAnnotationVariable(options, "add_mutable", substitute_template_prefix,
233  prepared_add_template, descriptor->index(),
234  "OnAddMutable", variables);
235 }
236 
238  std::map<std::string, std::string>* variables,
239  const Options& options) {
240  SetCommonVars(options, variables);
241  (*variables)["ns"] = Namespace(descriptor, options);
242  (*variables)["name"] = FieldName(descriptor);
243  (*variables)["index"] = StrCat(descriptor->index());
244  (*variables)["number"] = StrCat(descriptor->number());
245  (*variables)["classname"] = ClassName(FieldScope(descriptor), false);
246  (*variables)["declared_type"] = DeclaredTypeMethodName(descriptor->type());
247  (*variables)["field_member"] = FieldName(descriptor) + "_";
248 
249  (*variables)["tag_size"] = StrCat(
250  WireFormat::TagSize(descriptor->number(), descriptor->type()));
251  (*variables)["deprecated_attr"] = DeprecatedAttribute(options, descriptor);
252 
253  (*variables)["set_hasbit"] = "";
254  (*variables)["clear_hasbit"] = "";
255  if (HasHasbit(descriptor)) {
256  (*variables)["set_hasbit_io"] =
257  "_Internal::set_has_" + FieldName(descriptor) + "(&_has_bits_);";
258  } else {
259  (*variables)["set_hasbit_io"] = "";
260  }
261 
263 
264  // These variables are placeholders to pick out the beginning and ends of
265  // identifiers for annotations (when doing so with existing variables would
266  // be ambiguous or impossible). They should never be set to anything but the
267  // empty string.
268  (*variables)["{"] = "";
269  (*variables)["}"] = "";
270 }
271 
272 void FieldGenerator::SetHasBitIndex(int32_t has_bit_index) {
273  if (!HasHasbit(descriptor_)) {
274  GOOGLE_CHECK_EQ(has_bit_index, -1);
275  return;
276  }
277  variables_["set_hasbit"] = StrCat(
278  "_has_bits_[", has_bit_index / 32, "] |= 0x",
279  strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;");
280  variables_["clear_hasbit"] = StrCat(
281  "_has_bits_[", has_bit_index / 32, "] &= ~0x",
282  strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;");
283 }
284 
285 void FieldGenerator::SetInlinedStringIndex(int32_t inlined_string_index) {
287  GOOGLE_CHECK_EQ(inlined_string_index, -1);
288  return;
289  }
290  variables_["inlined_string_donated"] = StrCat(
291  "(_inlined_string_donated_[", inlined_string_index / 32, "] & 0x",
292  strings::Hex(1u << (inlined_string_index % 32), strings::ZERO_PAD_8),
293  "u) != 0;");
294  variables_["donating_states_word"] =
295  StrCat("_inlined_string_donated_[", inlined_string_index / 32, "]");
296  variables_["mask_for_undonate"] = StrCat(
297  "~0x", strings::Hex(1u << (inlined_string_index % 32), strings::ZERO_PAD_8),
298  "u");
299 }
300 
303  std::map<std::string, std::string>* variables) {
304  const std::string prefix = descriptor->containing_oneof()->name() + "_.";
305  (*variables)["oneof_name"] = descriptor->containing_oneof()->name();
306  (*variables)["field_member"] =
307  StrCat(prefix, (*variables)["name"], "_");
308 }
309 
311 
313  const Options& options,
314  MessageSCCAnalyzer* scc_analyzer)
315  : descriptor_(descriptor), field_generators_(descriptor->field_count()) {
316  // Construct all the FieldGenerators.
317  for (int i = 0; i < descriptor->field_count(); i++) {
318  field_generators_[i].reset(
319  MakeGenerator(descriptor->field(i), options, scc_analyzer));
320  }
321 }
322 
324  const FieldDescriptor* field, const Options& options,
325  MessageSCCAnalyzer* scc_analyzer) {
326 
327  return nullptr;
328 }
329 
330 FieldGenerator* FieldGeneratorMap::MakeGenerator(
331  const FieldDescriptor* field, const Options& options,
332  MessageSCCAnalyzer* scc_analyzer) {
333  FieldGenerator* generator =
334  MakeGoogleInternalGenerator(field, options, scc_analyzer);
335  if (generator) {
336  return generator;
337  }
338 
339  if (field->is_repeated()) {
340  switch (field->cpp_type()) {
342  if (field->is_map()) {
343  return new MapFieldGenerator(field, options, scc_analyzer);
344  } else {
345  return new RepeatedMessageFieldGenerator(field, options,
346  scc_analyzer);
347  }
349  return new RepeatedStringFieldGenerator(field, options);
351  return new RepeatedEnumFieldGenerator(field, options);
352  default:
353  return new RepeatedPrimitiveFieldGenerator(field, options);
354  }
355  } else if (field->real_containing_oneof()) {
356  switch (field->cpp_type()) {
358  return new MessageOneofFieldGenerator(field, options, scc_analyzer);
360  return new StringOneofFieldGenerator(field, options);
362  return new EnumOneofFieldGenerator(field, options);
363  default:
364  return new PrimitiveOneofFieldGenerator(field, options);
365  }
366  } else {
367  switch (field->cpp_type()) {
369  return new MessageFieldGenerator(field, options, scc_analyzer);
371  return new StringFieldGenerator(field, options);
373  return new EnumFieldGenerator(field, options);
374  default:
375  return new PrimitiveFieldGenerator(field, options);
376  }
377  }
378 }
379 
381 
382 const FieldGenerator& FieldGeneratorMap::get(
383  const FieldDescriptor* field) const {
384  GOOGLE_CHECK_EQ(field->containing_type(), descriptor_);
385  return *field_generators_[field->index()];
386 }
387 
388 } // namespace cpp
389 } // namespace compiler
390 } // namespace protobuf
391 } // namespace google
descriptor_
string_view descriptor_
Definition: elf.cc:154
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::compiler::cpp::FieldGenerator::variables_
std::map< std::string, std::string > variables_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h:191
google::protobuf.internal::WireFormat::TagSize
static size_t TagSize(int field_number, FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:331
google::protobuf::compiler::cpp::FieldGenerator::descriptor_
const FieldDescriptor * descriptor_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h:189
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
google::protobuf::compiler::cpp::HasHasbit
bool HasHasbit(const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:443
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::FieldGenerator::SetHasBitIndex
void SetHasBitIndex(int32 has_bit_index)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:93
google::protobuf::compiler::cpp::FieldGeneratorMap::MakeGenerator
static FieldGenerator * MakeGenerator(const FieldDescriptor *field, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:134
options
double_dict options[]
Definition: capstone_test.c:55
google::protobuf::compiler::cpp::SetCommonFieldVariables
void SetCommonFieldVariables(const FieldDescriptor *descriptor, std::map< std::string, std::string > *variables, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:58
GOOGLE_CHECK_EQ
#define GOOGLE_CHECK_EQ(A, B)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:156
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::compiler::cpp::FieldScope
const Descriptor * FieldScope(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:185
google::protobuf::compiler::cpp::FieldGenerator::SetInlinedStringIndex
void SetInlinedStringIndex(int32_t inlined_string_index)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:285
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::OneofDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:843
google::protobuf::strings::Hex
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:594
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::strings::ZERO_PAD_8
@ ZERO_PAD_8
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:583
google::protobuf::compiler::cpp::MakeDefaultName
std::string MakeDefaultName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:439
google::protobuf::FieldDescriptor::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:535
google::protobuf::OneofDescriptor::name
const std::string & name() const
google::protobuf::compiler::cpp::AddAccessorAnnotations
void AddAccessorAnnotations(const FieldDescriptor *descriptor, const Options &options, std::map< std::string, std::string > *variables)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:126
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1482
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::FieldGeneratorMap::MakeGoogleInternalGenerator
static FieldGenerator * MakeGoogleInternalGenerator(const FieldDescriptor *field, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:127
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::compiler::cpp::FieldGeneratorMap::~FieldGeneratorMap
~FieldGeneratorMap()
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:184
google::protobuf::compiler::cpp::FieldGeneratorMap::get
const FieldGenerator & get(const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:186
google::protobuf::compiler::cpp::FieldGeneratorMap::FieldGeneratorMap
FieldGeneratorMap(const Descriptor *descriptor, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:116
google::protobuf::compiler::cpp::DeprecatedAttribute
std::string DeprecatedAttribute(const Options &options, bool deprecated)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:68
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::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
google::protobuf::compiler::cpp::FieldGeneratorMap::field_generators_
std::vector< std::unique_ptr< FieldGenerator > > field_generators_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h:214
google::protobuf::compiler::cpp::Options
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h:52
google::protobuf::compiler::cpp::FieldGeneratorMap::descriptor_
const Descriptor * descriptor_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h:213
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
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
google::protobuf::compiler::cpp::FieldGenerator::~FieldGenerator
virtual ~FieldGenerator()
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:114
GOOGLE_ARRAYSIZE
#define GOOGLE_ARRAYSIZE(a)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/macros.h:88
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:561
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
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::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
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf::compiler::cpp::FieldGenerator::options_
const Options & options_
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h:190
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
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
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::compiler::cpp::SetCommonOneofFieldVariables
void SetCommonOneofFieldVariables(const FieldDescriptor *descriptor, std::map< std::string, std::string > *variables)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc:105


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