1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/source_location.proto
3
4 #include "protos/perfetto/trace/track_event/source_location.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
UnsymbolizedSourceLocation(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR UnsymbolizedSourceLocation::UnsymbolizedSourceLocation(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.iid_)*/::uint64_t{0u}
28 , /*decltype(_impl_.mapping_id_)*/::uint64_t{0u}
29 , /*decltype(_impl_.rel_pc_)*/::uint64_t{0u}} {}
30 struct UnsymbolizedSourceLocationDefaultTypeInternal {
UnsymbolizedSourceLocationDefaultTypeInternalperfetto::protos::UnsymbolizedSourceLocationDefaultTypeInternal31 PROTOBUF_CONSTEXPR UnsymbolizedSourceLocationDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~UnsymbolizedSourceLocationDefaultTypeInternalperfetto::protos::UnsymbolizedSourceLocationDefaultTypeInternal33 ~UnsymbolizedSourceLocationDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 UnsymbolizedSourceLocation _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UnsymbolizedSourceLocationDefaultTypeInternal _UnsymbolizedSourceLocation_default_instance_;
SourceLocation(::_pbi::ConstantInitialized)39 PROTOBUF_CONSTEXPR SourceLocation::SourceLocation(
40 ::_pbi::ConstantInitialized): _impl_{
41 /*decltype(_impl_._has_bits_)*/{}
42 , /*decltype(_impl_._cached_size_)*/{}
43 , /*decltype(_impl_.file_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
44 , /*decltype(_impl_.function_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
45 , /*decltype(_impl_.iid_)*/::uint64_t{0u}
46 , /*decltype(_impl_.line_number_)*/0u} {}
47 struct SourceLocationDefaultTypeInternal {
SourceLocationDefaultTypeInternalperfetto::protos::SourceLocationDefaultTypeInternal48 PROTOBUF_CONSTEXPR SourceLocationDefaultTypeInternal()
49 : _instance(::_pbi::ConstantInitialized{}) {}
~SourceLocationDefaultTypeInternalperfetto::protos::SourceLocationDefaultTypeInternal50 ~SourceLocationDefaultTypeInternal() {}
51 union { // NOLINT(misc-non-private-member-variables-in-classes)
52 SourceLocation _instance;
53 };
54 };
55 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceLocationDefaultTypeInternal _SourceLocation_default_instance_;
56 } // namespace protos
57 } // namespace perfetto
58 namespace perfetto {
59 namespace protos {
60
61 // ===================================================================
62
63 class UnsymbolizedSourceLocation::_Internal {
64 public:
65 using HasBits = decltype(std::declval<UnsymbolizedSourceLocation>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)66 static void set_has_iid(HasBits* has_bits) {
67 (*has_bits)[0] |= 1u;
68 }
set_has_mapping_id(HasBits * has_bits)69 static void set_has_mapping_id(HasBits* has_bits) {
70 (*has_bits)[0] |= 2u;
71 }
set_has_rel_pc(HasBits * has_bits)72 static void set_has_rel_pc(HasBits* has_bits) {
73 (*has_bits)[0] |= 4u;
74 }
75 };
76
UnsymbolizedSourceLocation(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)77 UnsymbolizedSourceLocation::UnsymbolizedSourceLocation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
78 bool is_message_owned)
79 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
80 SharedCtor(arena, is_message_owned);
81 // @@protoc_insertion_point(arena_constructor:perfetto.protos.UnsymbolizedSourceLocation)
82 }
UnsymbolizedSourceLocation(const UnsymbolizedSourceLocation & from)83 UnsymbolizedSourceLocation::UnsymbolizedSourceLocation(const UnsymbolizedSourceLocation& from)
84 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
85 UnsymbolizedSourceLocation* const _this = this; (void)_this;
86 new (&_impl_) Impl_{
87 decltype(_impl_._has_bits_){from._impl_._has_bits_}
88 , /*decltype(_impl_._cached_size_)*/{}
89 , decltype(_impl_.iid_){}
90 , decltype(_impl_.mapping_id_){}
91 , decltype(_impl_.rel_pc_){}};
92
93 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
94 ::memcpy(&_impl_.iid_, &from._impl_.iid_,
95 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.rel_pc_) -
96 reinterpret_cast<char*>(&_impl_.iid_)) + sizeof(_impl_.rel_pc_));
97 // @@protoc_insertion_point(copy_constructor:perfetto.protos.UnsymbolizedSourceLocation)
98 }
99
SharedCtor(::_pb::Arena * arena,bool is_message_owned)100 inline void UnsymbolizedSourceLocation::SharedCtor(
101 ::_pb::Arena* arena, bool is_message_owned) {
102 (void)arena;
103 (void)is_message_owned;
104 new (&_impl_) Impl_{
105 decltype(_impl_._has_bits_){}
106 , /*decltype(_impl_._cached_size_)*/{}
107 , decltype(_impl_.iid_){::uint64_t{0u}}
108 , decltype(_impl_.mapping_id_){::uint64_t{0u}}
109 , decltype(_impl_.rel_pc_){::uint64_t{0u}}
110 };
111 }
112
~UnsymbolizedSourceLocation()113 UnsymbolizedSourceLocation::~UnsymbolizedSourceLocation() {
114 // @@protoc_insertion_point(destructor:perfetto.protos.UnsymbolizedSourceLocation)
115 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
116 (void)arena;
117 return;
118 }
119 SharedDtor();
120 }
121
SharedDtor()122 inline void UnsymbolizedSourceLocation::SharedDtor() {
123 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
124 }
125
SetCachedSize(int size) const126 void UnsymbolizedSourceLocation::SetCachedSize(int size) const {
127 _impl_._cached_size_.Set(size);
128 }
129
Clear()130 void UnsymbolizedSourceLocation::Clear() {
131 // @@protoc_insertion_point(message_clear_start:perfetto.protos.UnsymbolizedSourceLocation)
132 ::uint32_t cached_has_bits = 0;
133 // Prevent compiler warnings about cached_has_bits being unused
134 (void) cached_has_bits;
135
136 cached_has_bits = _impl_._has_bits_[0];
137 if (cached_has_bits & 0x00000007u) {
138 ::memset(&_impl_.iid_, 0, static_cast<size_t>(
139 reinterpret_cast<char*>(&_impl_.rel_pc_) -
140 reinterpret_cast<char*>(&_impl_.iid_)) + sizeof(_impl_.rel_pc_));
141 }
142 _impl_._has_bits_.Clear();
143 _internal_metadata_.Clear<std::string>();
144 }
145
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)146 const char* UnsymbolizedSourceLocation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
147 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
148 _Internal::HasBits has_bits{};
149 while (!ctx->Done(&ptr)) {
150 ::uint32_t tag;
151 ptr = ::_pbi::ReadTag(ptr, &tag);
152 switch (tag >> 3) {
153 // optional uint64 iid = 1;
154 case 1:
155 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
156 _Internal::set_has_iid(&has_bits);
157 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
158 CHK_(ptr);
159 } else {
160 goto handle_unusual;
161 }
162 continue;
163 // optional uint64 mapping_id = 2;
164 case 2:
165 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
166 _Internal::set_has_mapping_id(&has_bits);
167 _impl_.mapping_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
168 CHK_(ptr);
169 } else {
170 goto handle_unusual;
171 }
172 continue;
173 // optional uint64 rel_pc = 3;
174 case 3:
175 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
176 _Internal::set_has_rel_pc(&has_bits);
177 _impl_.rel_pc_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
178 CHK_(ptr);
179 } else {
180 goto handle_unusual;
181 }
182 continue;
183 default:
184 goto handle_unusual;
185 } // switch
186 handle_unusual:
187 if ((tag == 0) || ((tag & 7) == 4)) {
188 CHK_(ptr);
189 ctx->SetLastTag(tag);
190 goto message_done;
191 }
192 ptr = UnknownFieldParse(
193 tag,
194 _internal_metadata_.mutable_unknown_fields<std::string>(),
195 ptr, ctx);
196 CHK_(ptr != nullptr);
197 } // while
198 message_done:
199 _impl_._has_bits_.Or(has_bits);
200 return ptr;
201 failure:
202 ptr = nullptr;
203 goto message_done;
204 #undef CHK_
205 }
206
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const207 ::uint8_t* UnsymbolizedSourceLocation::_InternalSerialize(
208 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
209 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.UnsymbolizedSourceLocation)
210 ::uint32_t cached_has_bits = 0;
211 (void) cached_has_bits;
212
213 cached_has_bits = _impl_._has_bits_[0];
214 // optional uint64 iid = 1;
215 if (cached_has_bits & 0x00000001u) {
216 target = stream->EnsureSpace(target);
217 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
218 }
219
220 // optional uint64 mapping_id = 2;
221 if (cached_has_bits & 0x00000002u) {
222 target = stream->EnsureSpace(target);
223 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_mapping_id(), target);
224 }
225
226 // optional uint64 rel_pc = 3;
227 if (cached_has_bits & 0x00000004u) {
228 target = stream->EnsureSpace(target);
229 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_rel_pc(), target);
230 }
231
232 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
233 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
234 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
235 }
236 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.UnsymbolizedSourceLocation)
237 return target;
238 }
239
ByteSizeLong() const240 size_t UnsymbolizedSourceLocation::ByteSizeLong() const {
241 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.UnsymbolizedSourceLocation)
242 size_t total_size = 0;
243
244 ::uint32_t cached_has_bits = 0;
245 // Prevent compiler warnings about cached_has_bits being unused
246 (void) cached_has_bits;
247
248 cached_has_bits = _impl_._has_bits_[0];
249 if (cached_has_bits & 0x00000007u) {
250 // optional uint64 iid = 1;
251 if (cached_has_bits & 0x00000001u) {
252 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
253 }
254
255 // optional uint64 mapping_id = 2;
256 if (cached_has_bits & 0x00000002u) {
257 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_mapping_id());
258 }
259
260 // optional uint64 rel_pc = 3;
261 if (cached_has_bits & 0x00000004u) {
262 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_rel_pc());
263 }
264
265 }
266 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
267 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
268 }
269 int cached_size = ::_pbi::ToCachedSize(total_size);
270 SetCachedSize(cached_size);
271 return total_size;
272 }
273
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)274 void UnsymbolizedSourceLocation::CheckTypeAndMergeFrom(
275 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
276 MergeFrom(*::_pbi::DownCast<const UnsymbolizedSourceLocation*>(
277 &from));
278 }
279
MergeFrom(const UnsymbolizedSourceLocation & from)280 void UnsymbolizedSourceLocation::MergeFrom(const UnsymbolizedSourceLocation& from) {
281 UnsymbolizedSourceLocation* const _this = this;
282 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.UnsymbolizedSourceLocation)
283 GOOGLE_DCHECK_NE(&from, _this);
284 ::uint32_t cached_has_bits = 0;
285 (void) cached_has_bits;
286
287 cached_has_bits = from._impl_._has_bits_[0];
288 if (cached_has_bits & 0x00000007u) {
289 if (cached_has_bits & 0x00000001u) {
290 _this->_impl_.iid_ = from._impl_.iid_;
291 }
292 if (cached_has_bits & 0x00000002u) {
293 _this->_impl_.mapping_id_ = from._impl_.mapping_id_;
294 }
295 if (cached_has_bits & 0x00000004u) {
296 _this->_impl_.rel_pc_ = from._impl_.rel_pc_;
297 }
298 _this->_impl_._has_bits_[0] |= cached_has_bits;
299 }
300 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
301 }
302
CopyFrom(const UnsymbolizedSourceLocation & from)303 void UnsymbolizedSourceLocation::CopyFrom(const UnsymbolizedSourceLocation& from) {
304 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.UnsymbolizedSourceLocation)
305 if (&from == this) return;
306 Clear();
307 MergeFrom(from);
308 }
309
IsInitialized() const310 bool UnsymbolizedSourceLocation::IsInitialized() const {
311 return true;
312 }
313
InternalSwap(UnsymbolizedSourceLocation * other)314 void UnsymbolizedSourceLocation::InternalSwap(UnsymbolizedSourceLocation* other) {
315 using std::swap;
316 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
317 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
318 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
319 PROTOBUF_FIELD_OFFSET(UnsymbolizedSourceLocation, _impl_.rel_pc_)
320 + sizeof(UnsymbolizedSourceLocation::_impl_.rel_pc_) // NOLINT
321 - PROTOBUF_FIELD_OFFSET(UnsymbolizedSourceLocation, _impl_.iid_)>(
322 reinterpret_cast<char*>(&_impl_.iid_),
323 reinterpret_cast<char*>(&other->_impl_.iid_));
324 }
325
GetTypeName() const326 std::string UnsymbolizedSourceLocation::GetTypeName() const {
327 return "perfetto.protos.UnsymbolizedSourceLocation";
328 }
329
330
331 // ===================================================================
332
333 class SourceLocation::_Internal {
334 public:
335 using HasBits = decltype(std::declval<SourceLocation>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)336 static void set_has_iid(HasBits* has_bits) {
337 (*has_bits)[0] |= 4u;
338 }
set_has_file_name(HasBits * has_bits)339 static void set_has_file_name(HasBits* has_bits) {
340 (*has_bits)[0] |= 1u;
341 }
set_has_function_name(HasBits * has_bits)342 static void set_has_function_name(HasBits* has_bits) {
343 (*has_bits)[0] |= 2u;
344 }
set_has_line_number(HasBits * has_bits)345 static void set_has_line_number(HasBits* has_bits) {
346 (*has_bits)[0] |= 8u;
347 }
348 };
349
SourceLocation(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)350 SourceLocation::SourceLocation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
351 bool is_message_owned)
352 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
353 SharedCtor(arena, is_message_owned);
354 // @@protoc_insertion_point(arena_constructor:perfetto.protos.SourceLocation)
355 }
SourceLocation(const SourceLocation & from)356 SourceLocation::SourceLocation(const SourceLocation& from)
357 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
358 SourceLocation* const _this = this; (void)_this;
359 new (&_impl_) Impl_{
360 decltype(_impl_._has_bits_){from._impl_._has_bits_}
361 , /*decltype(_impl_._cached_size_)*/{}
362 , decltype(_impl_.file_name_){}
363 , decltype(_impl_.function_name_){}
364 , decltype(_impl_.iid_){}
365 , decltype(_impl_.line_number_){}};
366
367 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
368 _impl_.file_name_.InitDefault();
369 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
370 _impl_.file_name_.Set("", GetArenaForAllocation());
371 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
372 if (from._internal_has_file_name()) {
373 _this->_impl_.file_name_.Set(from._internal_file_name(),
374 _this->GetArenaForAllocation());
375 }
376 _impl_.function_name_.InitDefault();
377 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
378 _impl_.function_name_.Set("", GetArenaForAllocation());
379 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
380 if (from._internal_has_function_name()) {
381 _this->_impl_.function_name_.Set(from._internal_function_name(),
382 _this->GetArenaForAllocation());
383 }
384 ::memcpy(&_impl_.iid_, &from._impl_.iid_,
385 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.line_number_) -
386 reinterpret_cast<char*>(&_impl_.iid_)) + sizeof(_impl_.line_number_));
387 // @@protoc_insertion_point(copy_constructor:perfetto.protos.SourceLocation)
388 }
389
SharedCtor(::_pb::Arena * arena,bool is_message_owned)390 inline void SourceLocation::SharedCtor(
391 ::_pb::Arena* arena, bool is_message_owned) {
392 (void)arena;
393 (void)is_message_owned;
394 new (&_impl_) Impl_{
395 decltype(_impl_._has_bits_){}
396 , /*decltype(_impl_._cached_size_)*/{}
397 , decltype(_impl_.file_name_){}
398 , decltype(_impl_.function_name_){}
399 , decltype(_impl_.iid_){::uint64_t{0u}}
400 , decltype(_impl_.line_number_){0u}
401 };
402 _impl_.file_name_.InitDefault();
403 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
404 _impl_.file_name_.Set("", GetArenaForAllocation());
405 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
406 _impl_.function_name_.InitDefault();
407 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
408 _impl_.function_name_.Set("", GetArenaForAllocation());
409 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
410 }
411
~SourceLocation()412 SourceLocation::~SourceLocation() {
413 // @@protoc_insertion_point(destructor:perfetto.protos.SourceLocation)
414 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
415 (void)arena;
416 return;
417 }
418 SharedDtor();
419 }
420
SharedDtor()421 inline void SourceLocation::SharedDtor() {
422 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
423 _impl_.file_name_.Destroy();
424 _impl_.function_name_.Destroy();
425 }
426
SetCachedSize(int size) const427 void SourceLocation::SetCachedSize(int size) const {
428 _impl_._cached_size_.Set(size);
429 }
430
Clear()431 void SourceLocation::Clear() {
432 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SourceLocation)
433 ::uint32_t cached_has_bits = 0;
434 // Prevent compiler warnings about cached_has_bits being unused
435 (void) cached_has_bits;
436
437 cached_has_bits = _impl_._has_bits_[0];
438 if (cached_has_bits & 0x00000003u) {
439 if (cached_has_bits & 0x00000001u) {
440 _impl_.file_name_.ClearNonDefaultToEmpty();
441 }
442 if (cached_has_bits & 0x00000002u) {
443 _impl_.function_name_.ClearNonDefaultToEmpty();
444 }
445 }
446 if (cached_has_bits & 0x0000000cu) {
447 ::memset(&_impl_.iid_, 0, static_cast<size_t>(
448 reinterpret_cast<char*>(&_impl_.line_number_) -
449 reinterpret_cast<char*>(&_impl_.iid_)) + sizeof(_impl_.line_number_));
450 }
451 _impl_._has_bits_.Clear();
452 _internal_metadata_.Clear<std::string>();
453 }
454
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)455 const char* SourceLocation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
456 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
457 _Internal::HasBits has_bits{};
458 while (!ctx->Done(&ptr)) {
459 ::uint32_t tag;
460 ptr = ::_pbi::ReadTag(ptr, &tag);
461 switch (tag >> 3) {
462 // optional uint64 iid = 1;
463 case 1:
464 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
465 _Internal::set_has_iid(&has_bits);
466 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
467 CHK_(ptr);
468 } else {
469 goto handle_unusual;
470 }
471 continue;
472 // optional string file_name = 2;
473 case 2:
474 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
475 auto str = _internal_mutable_file_name();
476 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
477 CHK_(ptr);
478 } else {
479 goto handle_unusual;
480 }
481 continue;
482 // optional string function_name = 3;
483 case 3:
484 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
485 auto str = _internal_mutable_function_name();
486 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
487 CHK_(ptr);
488 } else {
489 goto handle_unusual;
490 }
491 continue;
492 // optional uint32 line_number = 4;
493 case 4:
494 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
495 _Internal::set_has_line_number(&has_bits);
496 _impl_.line_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
497 CHK_(ptr);
498 } else {
499 goto handle_unusual;
500 }
501 continue;
502 default:
503 goto handle_unusual;
504 } // switch
505 handle_unusual:
506 if ((tag == 0) || ((tag & 7) == 4)) {
507 CHK_(ptr);
508 ctx->SetLastTag(tag);
509 goto message_done;
510 }
511 ptr = UnknownFieldParse(
512 tag,
513 _internal_metadata_.mutable_unknown_fields<std::string>(),
514 ptr, ctx);
515 CHK_(ptr != nullptr);
516 } // while
517 message_done:
518 _impl_._has_bits_.Or(has_bits);
519 return ptr;
520 failure:
521 ptr = nullptr;
522 goto message_done;
523 #undef CHK_
524 }
525
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const526 ::uint8_t* SourceLocation::_InternalSerialize(
527 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
528 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SourceLocation)
529 ::uint32_t cached_has_bits = 0;
530 (void) cached_has_bits;
531
532 cached_has_bits = _impl_._has_bits_[0];
533 // optional uint64 iid = 1;
534 if (cached_has_bits & 0x00000004u) {
535 target = stream->EnsureSpace(target);
536 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
537 }
538
539 // optional string file_name = 2;
540 if (cached_has_bits & 0x00000001u) {
541 target = stream->WriteStringMaybeAliased(
542 2, this->_internal_file_name(), target);
543 }
544
545 // optional string function_name = 3;
546 if (cached_has_bits & 0x00000002u) {
547 target = stream->WriteStringMaybeAliased(
548 3, this->_internal_function_name(), target);
549 }
550
551 // optional uint32 line_number = 4;
552 if (cached_has_bits & 0x00000008u) {
553 target = stream->EnsureSpace(target);
554 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_line_number(), target);
555 }
556
557 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
558 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
559 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
560 }
561 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SourceLocation)
562 return target;
563 }
564
ByteSizeLong() const565 size_t SourceLocation::ByteSizeLong() const {
566 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SourceLocation)
567 size_t total_size = 0;
568
569 ::uint32_t cached_has_bits = 0;
570 // Prevent compiler warnings about cached_has_bits being unused
571 (void) cached_has_bits;
572
573 cached_has_bits = _impl_._has_bits_[0];
574 if (cached_has_bits & 0x0000000fu) {
575 // optional string file_name = 2;
576 if (cached_has_bits & 0x00000001u) {
577 total_size += 1 +
578 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
579 this->_internal_file_name());
580 }
581
582 // optional string function_name = 3;
583 if (cached_has_bits & 0x00000002u) {
584 total_size += 1 +
585 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
586 this->_internal_function_name());
587 }
588
589 // optional uint64 iid = 1;
590 if (cached_has_bits & 0x00000004u) {
591 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
592 }
593
594 // optional uint32 line_number = 4;
595 if (cached_has_bits & 0x00000008u) {
596 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_line_number());
597 }
598
599 }
600 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
601 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
602 }
603 int cached_size = ::_pbi::ToCachedSize(total_size);
604 SetCachedSize(cached_size);
605 return total_size;
606 }
607
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)608 void SourceLocation::CheckTypeAndMergeFrom(
609 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
610 MergeFrom(*::_pbi::DownCast<const SourceLocation*>(
611 &from));
612 }
613
MergeFrom(const SourceLocation & from)614 void SourceLocation::MergeFrom(const SourceLocation& from) {
615 SourceLocation* const _this = this;
616 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SourceLocation)
617 GOOGLE_DCHECK_NE(&from, _this);
618 ::uint32_t cached_has_bits = 0;
619 (void) cached_has_bits;
620
621 cached_has_bits = from._impl_._has_bits_[0];
622 if (cached_has_bits & 0x0000000fu) {
623 if (cached_has_bits & 0x00000001u) {
624 _this->_internal_set_file_name(from._internal_file_name());
625 }
626 if (cached_has_bits & 0x00000002u) {
627 _this->_internal_set_function_name(from._internal_function_name());
628 }
629 if (cached_has_bits & 0x00000004u) {
630 _this->_impl_.iid_ = from._impl_.iid_;
631 }
632 if (cached_has_bits & 0x00000008u) {
633 _this->_impl_.line_number_ = from._impl_.line_number_;
634 }
635 _this->_impl_._has_bits_[0] |= cached_has_bits;
636 }
637 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
638 }
639
CopyFrom(const SourceLocation & from)640 void SourceLocation::CopyFrom(const SourceLocation& from) {
641 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SourceLocation)
642 if (&from == this) return;
643 Clear();
644 MergeFrom(from);
645 }
646
IsInitialized() const647 bool SourceLocation::IsInitialized() const {
648 return true;
649 }
650
InternalSwap(SourceLocation * other)651 void SourceLocation::InternalSwap(SourceLocation* other) {
652 using std::swap;
653 auto* lhs_arena = GetArenaForAllocation();
654 auto* rhs_arena = other->GetArenaForAllocation();
655 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
656 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
657 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
658 &_impl_.file_name_, lhs_arena,
659 &other->_impl_.file_name_, rhs_arena
660 );
661 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
662 &_impl_.function_name_, lhs_arena,
663 &other->_impl_.function_name_, rhs_arena
664 );
665 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
666 PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.line_number_)
667 + sizeof(SourceLocation::_impl_.line_number_) // NOLINT
668 - PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.iid_)>(
669 reinterpret_cast<char*>(&_impl_.iid_),
670 reinterpret_cast<char*>(&other->_impl_.iid_));
671 }
672
GetTypeName() const673 std::string SourceLocation::GetTypeName() const {
674 return "perfetto.protos.SourceLocation";
675 }
676
677
678 // @@protoc_insertion_point(namespace_scope)
679 } // namespace protos
680 } // namespace perfetto
681 PROTOBUF_NAMESPACE_OPEN
682 template<> PROTOBUF_NOINLINE ::perfetto::protos::UnsymbolizedSourceLocation*
CreateMaybeMessage(Arena * arena)683 Arena::CreateMaybeMessage< ::perfetto::protos::UnsymbolizedSourceLocation >(Arena* arena) {
684 return Arena::CreateMessageInternal< ::perfetto::protos::UnsymbolizedSourceLocation >(arena);
685 }
686 template<> PROTOBUF_NOINLINE ::perfetto::protos::SourceLocation*
CreateMaybeMessage(Arena * arena)687 Arena::CreateMaybeMessage< ::perfetto::protos::SourceLocation >(Arena* arena) {
688 return Arena::CreateMessageInternal< ::perfetto::protos::SourceLocation >(arena);
689 }
690 PROTOBUF_NAMESPACE_CLOSE
691
692 // @@protoc_insertion_point(global_scope)
693 #include <google/protobuf/port_undef.inc>
694