LLDB  mainline
SBType.cpp
Go to the documentation of this file.
1 //===-- SBType.cpp ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lldb/API/SBType.h"
10 #include "SBReproducerPrivate.h"
11 #include "lldb/API/SBDefines.h"
12 #include "lldb/API/SBStream.h"
14 #include "lldb/Core/Mangled.h"
16 #include "lldb/Symbol/Type.h"
17 #include "lldb/Symbol/TypeSystem.h"
19 #include "lldb/Utility/Stream.h"
20 
21 #include "llvm/ADT/APSInt.h"
22 
23 #include <memory>
24 
25 using namespace lldb;
26 using namespace lldb_private;
27 
29 
31  : m_opaque_sp(new TypeImpl(
32  CompilerType(type.GetTypeSystem(), type.GetOpaqueQualType()))) {}
33 
34 SBType::SBType(const lldb::TypeSP &type_sp)
35  : m_opaque_sp(new TypeImpl(type_sp)) {}
36 
37 SBType::SBType(const lldb::TypeImplSP &type_impl_sp)
38  : m_opaque_sp(type_impl_sp) {}
39 
42 
43  if (this != &rhs) {
45  }
46 }
47 
48 // SBType::SBType (TypeImpl* impl) :
49 // m_opaque_up(impl)
50 //{}
51 //
53  LLDB_RECORD_METHOD(bool, SBType, operator==,(lldb::SBType &), rhs);
54 
55  if (!IsValid())
56  return !rhs.IsValid();
57 
58  if (!rhs.IsValid())
59  return false;
60 
61  return *m_opaque_sp.get() == *rhs.m_opaque_sp.get();
62 }
63 
65  LLDB_RECORD_METHOD(bool, SBType, operator!=,(lldb::SBType &), rhs);
66 
67  if (!IsValid())
68  return rhs.IsValid();
69 
70  if (!rhs.IsValid())
71  return true;
72 
73  return *m_opaque_sp.get() != *rhs.m_opaque_sp.get();
74 }
75 
76 lldb::TypeImplSP SBType::GetSP() { return m_opaque_sp; }
77 
78 void SBType::SetSP(const lldb::TypeImplSP &type_impl_sp) {
79  m_opaque_sp = type_impl_sp;
80 }
81 
83  LLDB_RECORD_METHOD(lldb::SBType &, SBType, operator=,(const lldb::SBType &),
84  rhs);
85 
86  if (this != &rhs) {
88  }
89  return LLDB_RECORD_RESULT(*this);
90 }
91 
93 
95  if (m_opaque_sp.get() == NULL)
96  m_opaque_sp = std::make_shared<TypeImpl>();
97  return *m_opaque_sp;
98 }
99 
100 const TypeImpl &SBType::ref() const {
101  // "const SBAddress &addr" should already have checked "addr.IsValid()" prior
102  // to calling this function. In case you didn't we will assert and die to let
103  // you know.
104  assert(m_opaque_sp.get());
105  return *m_opaque_sp;
106 }
107 
108 bool SBType::IsValid() const {
110  return this->operator bool();
111 }
112 SBType::operator bool() const {
113  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBType, operator bool);
114 
115  if (m_opaque_sp.get() == NULL)
116  return false;
117 
118  return m_opaque_sp->IsValid();
119 }
120 
123 
124  if (IsValid())
125  if (llvm::Optional<uint64_t> size =
126  m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr))
127  return *size;
128  return 0;
129 }
130 
133 
134  if (!IsValid())
135  return false;
136  return m_opaque_sp->GetCompilerType(true).IsPointerType();
137 }
138 
141 
142  if (!IsValid())
143  return false;
144  return m_opaque_sp->GetCompilerType(true).IsArrayType(nullptr, nullptr,
145  nullptr);
146 }
147 
150 
151  if (!IsValid())
152  return false;
153  return m_opaque_sp->GetCompilerType(true).IsVectorType(nullptr, nullptr);
154 }
155 
158 
159  if (!IsValid())
160  return false;
161  return m_opaque_sp->GetCompilerType(true).IsReferenceType();
162 }
163 
166 
167  if (!IsValid())
168  return LLDB_RECORD_RESULT(SBType());
169 
170  return LLDB_RECORD_RESULT(
171  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointerType()))));
172 }
173 
176 
177  if (!IsValid())
178  return LLDB_RECORD_RESULT(SBType());
179  return LLDB_RECORD_RESULT(
180  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointeeType()))));
181 }
182 
185 
186  if (!IsValid())
187  return LLDB_RECORD_RESULT(SBType());
188  return LLDB_RECORD_RESULT(
189  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType()))));
190 }
191 
194 
195  if (!IsValid())
196  return LLDB_RECORD_RESULT(SBType());
197  return LLDB_RECORD_RESULT(
198  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType()))));
199 }
200 
203 
204  if (!IsValid())
205  return LLDB_RECORD_RESULT(SBType());
206  return LLDB_RECORD_RESULT(
207  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType()))));
208 }
209 
212 
213  if (!IsValid())
214  return LLDB_RECORD_RESULT(SBType());
215  return LLDB_RECORD_RESULT(SBType(TypeImplSP(
216  new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayElementType()))));
217 }
218 
219 SBType SBType::GetArrayType(uint64_t size) {
220  LLDB_RECORD_METHOD(lldb::SBType, SBType, GetArrayType, (uint64_t), size);
221 
222  if (!IsValid())
223  return LLDB_RECORD_RESULT(SBType());
224  return LLDB_RECORD_RESULT(SBType(TypeImplSP(
225  new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size)))));
226 }
227 
230 
231  SBType type_sb;
232  if (IsValid()) {
233  CompilerType vector_element_type;
234  if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type,
235  nullptr))
236  type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type)));
237  }
238  return LLDB_RECORD_RESULT(type_sb);
239 }
240 
243 
244  if (!IsValid())
245  return false;
246  return m_opaque_sp->GetCompilerType(true).IsFunctionType();
247 }
248 
251 
252  if (!IsValid())
253  return false;
254  return m_opaque_sp->GetCompilerType(true).IsPolymorphicClass();
255 }
256 
259 
260  if (!IsValid())
261  return false;
262  return m_opaque_sp->GetCompilerType(true).IsTypedefType();
263 }
264 
267 
268  if (!IsValid())
269  return false;
270  return m_opaque_sp->GetCompilerType(true).IsAnonymousType();
271 }
272 
275 
276  if (IsValid()) {
277  CompilerType return_type(
278  m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
279  if (return_type.IsValid())
280  return LLDB_RECORD_RESULT(SBType(return_type));
281  }
283 }
284 
288 
289  SBTypeList sb_type_list;
290  if (IsValid()) {
291  CompilerType func_type(m_opaque_sp->GetCompilerType(true));
292  size_t count = func_type.GetNumberOfFunctionArguments();
293  for (size_t i = 0; i < count; i++) {
294  sb_type_list.Append(SBType(func_type.GetFunctionArgumentAtIndex(i)));
295  }
296  }
297  return LLDB_RECORD_RESULT(sb_type_list);
298 }
299 
302 
303  if (IsValid()) {
304  return m_opaque_sp->GetCompilerType(true).GetNumMemberFunctions();
305  }
306  return 0;
307 }
308 
312 
313  SBTypeMemberFunction sb_func_type;
314  if (IsValid())
315  sb_func_type.reset(new TypeMemberFunctionImpl(
316  m_opaque_sp->GetCompilerType(true).GetMemberFunctionAtIndex(idx)));
317  return LLDB_RECORD_RESULT(sb_func_type);
318 }
319 
322 
323  if (!IsValid())
324  return LLDB_RECORD_RESULT(SBType());
325  return LLDB_RECORD_RESULT(
326  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetUnqualifiedType()))));
327 }
328 
331 
332  if (IsValid())
333  return LLDB_RECORD_RESULT(
334  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCanonicalType()))));
335  return LLDB_RECORD_RESULT(SBType());
336 }
337 
340 
341  if (IsValid())
342  return m_opaque_sp->GetCompilerType(false).GetBasicTypeEnumeration();
343  return eBasicTypeInvalid;
344 }
345 
348  basic_type);
349 
350  if (IsValid() && m_opaque_sp->IsValid())
351  return LLDB_RECORD_RESULT(SBType(
352  m_opaque_sp->GetTypeSystem(false)->GetBasicTypeFromAST(basic_type)));
353  return LLDB_RECORD_RESULT(SBType());
354 }
355 
358 
359  if (IsValid())
360  return m_opaque_sp->GetCompilerType(true).GetNumDirectBaseClasses();
361  return 0;
362 }
363 
366 
367  if (IsValid())
368  return m_opaque_sp->GetCompilerType(true).GetNumVirtualBaseClasses();
369  return 0;
370 }
371 
374 
375  if (IsValid())
376  return m_opaque_sp->GetCompilerType(true).GetNumFields();
377  return 0;
378 }
379 
381  lldb::DescriptionLevel description_level) {
383  (lldb::SBStream &, lldb::DescriptionLevel), description,
384  description_level);
385 
386  Stream &strm = description.ref();
387 
388  if (m_opaque_sp) {
389  m_opaque_sp->GetDescription(strm, description_level);
390  } else
391  strm.PutCString("No value");
392 
393  return true;
394 }
395 
398  (uint32_t), idx);
399 
400  SBTypeMember sb_type_member;
401  if (IsValid()) {
402  uint32_t bit_offset = 0;
403  CompilerType base_class_type =
404  m_opaque_sp->GetCompilerType(true).GetDirectBaseClassAtIndex(
405  idx, &bit_offset);
406  if (base_class_type.IsValid())
407  sb_type_member.reset(new TypeMemberImpl(
408  TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
409  }
410  return LLDB_RECORD_RESULT(sb_type_member);
411 }
412 
415  (uint32_t), idx);
416 
417  SBTypeMember sb_type_member;
418  if (IsValid()) {
419  uint32_t bit_offset = 0;
420  CompilerType base_class_type =
421  m_opaque_sp->GetCompilerType(true).GetVirtualBaseClassAtIndex(
422  idx, &bit_offset);
423  if (base_class_type.IsValid())
424  sb_type_member.reset(new TypeMemberImpl(
425  TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
426  }
427  return LLDB_RECORD_RESULT(sb_type_member);
428 }
429 
433 
434  SBTypeEnumMemberList sb_enum_member_list;
435  if (IsValid()) {
436  CompilerType this_type(m_opaque_sp->GetCompilerType(true));
437  if (this_type.IsValid()) {
438  this_type.ForEachEnumerator([&sb_enum_member_list](
439  const CompilerType &integer_type,
440  ConstString name,
441  const llvm::APSInt &value) -> bool {
442  SBTypeEnumMember enum_member(
443  lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
444  lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
445  sb_enum_member_list.Append(enum_member);
446  return true; // Keep iterating
447  });
448  }
449  }
450  return LLDB_RECORD_RESULT(sb_enum_member_list);
451 }
452 
455  idx);
456 
457  SBTypeMember sb_type_member;
458  if (IsValid()) {
459  CompilerType this_type(m_opaque_sp->GetCompilerType(false));
460  if (this_type.IsValid()) {
461  uint64_t bit_offset = 0;
462  uint32_t bitfield_bit_size = 0;
463  bool is_bitfield = false;
464  std::string name_sstr;
465  CompilerType field_type(this_type.GetFieldAtIndex(
466  idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
467  if (field_type.IsValid()) {
468  ConstString name;
469  if (!name_sstr.empty())
470  name.SetCString(name_sstr.c_str());
471  sb_type_member.reset(
472  new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type)), bit_offset,
473  name, bitfield_bit_size, is_bitfield));
474  }
475  }
476  }
477  return LLDB_RECORD_RESULT(sb_type_member);
478 }
479 
482 
483  if (!IsValid())
484  return false;
485  return m_opaque_sp->GetCompilerType(false).IsCompleteType();
486 }
487 
490 
491  if (!IsValid())
492  return 0;
493  return m_opaque_sp->GetCompilerType(true).GetTypeInfo();
494 }
495 
496 const char *SBType::GetName() {
497  LLDB_RECORD_METHOD_NO_ARGS(const char *, SBType, GetName);
498 
499  if (!IsValid())
500  return "";
501  return m_opaque_sp->GetName().GetCString();
502 }
503 
506 
507  if (!IsValid())
508  return "";
509  return m_opaque_sp->GetDisplayTypeName().GetCString();
510 }
511 
512 lldb::TypeClass SBType::GetTypeClass() {
514 
515  if (IsValid())
516  return m_opaque_sp->GetCompilerType(true).GetTypeClass();
517  return lldb::eTypeClassInvalid;
518 }
519 
522 
523  if (IsValid())
524  return m_opaque_sp->GetCompilerType(false).GetNumTemplateArguments();
525  return 0;
526 }
527 
530  idx);
531 
532  if (!IsValid())
533  return LLDB_RECORD_RESULT(SBType());
534 
535  CompilerType type;
536  switch(GetTemplateArgumentKind(idx)) {
538  type = m_opaque_sp->GetCompilerType(false).GetTypeTemplateArgument(idx);
539  break;
541  type = m_opaque_sp->GetCompilerType(false)
542  .GetIntegralTemplateArgument(idx)
543  ->type;
544  break;
545  default:
546  break;
547  }
548  if (type.IsValid())
549  return LLDB_RECORD_RESULT(SBType(type));
550  return LLDB_RECORD_RESULT(SBType());
551 }
552 
556 
557  if (IsValid())
558  return m_opaque_sp->GetCompilerType(false).GetTemplateArgumentKind(idx);
560 }
561 
562 SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {
564 }
565 
567  : m_opaque_up(new TypeListImpl()) {
569 
570  for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
571  i < rhs_size; i++)
572  Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
573 }
574 
577  return this->operator bool();
578 }
579 SBTypeList::operator bool() const {
580  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeList, operator bool);
581 
582  return (m_opaque_up != NULL);
583 }
584 
587  SBTypeList, operator=,(const lldb::SBTypeList &), rhs);
588 
589  if (this != &rhs) {
590  m_opaque_up.reset(new TypeListImpl());
591  for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
592  i < rhs_size; i++)
593  Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
594  }
595  return LLDB_RECORD_RESULT(*this);
596 }
597 
600 
601  if (type.IsValid())
602  m_opaque_up->Append(type.m_opaque_sp);
603 }
604 
607  index);
608 
609  if (m_opaque_up)
610  return LLDB_RECORD_RESULT(SBType(m_opaque_up->GetTypeAtIndex(index)));
611  return LLDB_RECORD_RESULT(SBType());
612 }
613 
616 
617  return m_opaque_up->GetSize();
618 }
619 
621 
622 SBTypeMember::SBTypeMember() : m_opaque_up() {
624 }
625 
627 
630 
631  if (this != &rhs) {
632  if (rhs.IsValid())
633  m_opaque_up.reset(new TypeMemberImpl(rhs.ref()));
634  }
635 }
636 
639  SBTypeMember, operator=,(const lldb::SBTypeMember &), rhs);
640 
641  if (this != &rhs) {
642  if (rhs.IsValid())
643  m_opaque_up.reset(new TypeMemberImpl(rhs.ref()));
644  }
645  return LLDB_RECORD_RESULT(*this);
646 }
647 
648 bool SBTypeMember::IsValid() const {
650  return this->operator bool();
651 }
652 SBTypeMember::operator bool() const {
653  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeMember, operator bool);
654 
655  return m_opaque_up.get();
656 }
657 
658 const char *SBTypeMember::GetName() {
660 
661  if (m_opaque_up)
662  return m_opaque_up->GetName().GetCString();
663  return NULL;
664 }
665 
668 
669  SBType sb_type;
670  if (m_opaque_up) {
671  sb_type.SetSP(m_opaque_up->GetTypeImpl());
672  }
673  return LLDB_RECORD_RESULT(sb_type);
674 }
675 
678 
679  if (m_opaque_up)
680  return m_opaque_up->GetBitOffset() / 8u;
681  return 0;
682 }
683 
686 
687  if (m_opaque_up)
688  return m_opaque_up->GetBitOffset();
689  return 0;
690 }
691 
694 
695  if (m_opaque_up)
696  return m_opaque_up->GetIsBitfield();
697  return false;
698 }
699 
702 
703  if (m_opaque_up)
704  return m_opaque_up->GetBitfieldBitSize();
705  return 0;
706 }
707 
709  lldb::DescriptionLevel description_level) {
711  (lldb::SBStream &, lldb::DescriptionLevel), description,
712  description_level);
713 
714  Stream &strm = description.ref();
715 
716  if (m_opaque_up) {
717  const uint32_t bit_offset = m_opaque_up->GetBitOffset();
718  const uint32_t byte_offset = bit_offset / 8u;
719  const uint32_t byte_bit_offset = bit_offset % 8u;
720  const char *name = m_opaque_up->GetName().GetCString();
721  if (byte_bit_offset)
722  strm.Printf("+%u + %u bits: (", byte_offset, byte_bit_offset);
723  else
724  strm.Printf("+%u: (", byte_offset);
725 
726  TypeImplSP type_impl_sp(m_opaque_up->GetTypeImpl());
727  if (type_impl_sp)
728  type_impl_sp->GetDescription(strm, description_level);
729 
730  strm.Printf(") %s", name);
731  if (m_opaque_up->GetIsBitfield()) {
732  const uint32_t bitfield_bit_size = m_opaque_up->GetBitfieldBitSize();
733  strm.Printf(" : %u", bitfield_bit_size);
734  }
735  } else {
736  strm.PutCString("No value");
737  }
738  return true;
739 }
740 
741 void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
742  m_opaque_up.reset(type_member_impl);
743 }
744 
746  if (m_opaque_up == NULL)
747  m_opaque_up.reset(new TypeMemberImpl());
748  return *m_opaque_up;
749 }
750 
751 const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_up; }
752 
755 }
756 
758 
760  : m_opaque_sp(rhs.m_opaque_sp) {
762  (const lldb::SBTypeMemberFunction &), rhs);
763 }
764 
770  rhs);
771 
772  if (this != &rhs)
773  m_opaque_sp = rhs.m_opaque_sp;
774  return LLDB_RECORD_RESULT(*this);
775 }
776 
779  return this->operator bool();
780 }
781 SBTypeMemberFunction::operator bool() const {
783 
784  return m_opaque_sp.get();
785 }
786 
789 
790  if (m_opaque_sp)
791  return m_opaque_sp->GetName().GetCString();
792  return NULL;
793 }
794 
798 
799  if (m_opaque_sp) {
800  ConstString mangled_str = m_opaque_sp->GetMangledName();
801  if (mangled_str) {
802  Mangled mangled(mangled_str, true);
803  return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString();
804  }
805  }
806  return NULL;
807 }
808 
812 
813  if (m_opaque_sp)
814  return m_opaque_sp->GetMangledName().GetCString();
815  return NULL;
816 }
817 
820 
821  SBType sb_type;
822  if (m_opaque_sp) {
823  sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetType())));
824  }
825  return LLDB_RECORD_RESULT(sb_type);
826 }
827 
830 
831  SBType sb_type;
832  if (m_opaque_sp) {
833  sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetReturnType())));
834  }
835  return LLDB_RECORD_RESULT(sb_type);
836 }
837 
841 
842  if (m_opaque_sp)
843  return m_opaque_sp->GetNumArguments();
844  return 0;
845 }
846 
849  (uint32_t), i);
850 
851  SBType sb_type;
852  if (m_opaque_sp) {
853  sb_type.SetSP(
854  lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetArgumentAtIndex(i))));
855  }
856  return LLDB_RECORD_RESULT(sb_type);
857 }
858 
861  GetKind);
862 
863  if (m_opaque_sp)
864  return m_opaque_sp->GetKind();
866 }
867 
869  lldb::SBStream &description, lldb::DescriptionLevel description_level) {
871  (lldb::SBStream &, lldb::DescriptionLevel), description,
872  description_level);
873 
874  Stream &strm = description.ref();
875 
876  if (m_opaque_sp)
877  return m_opaque_sp->GetDescription(strm);
878 
879  return false;
880 }
881 
883  m_opaque_sp.reset(type_member_impl);
884 }
885 
887  if (!m_opaque_sp)
888  m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
889  return *m_opaque_sp.get();
890 }
891 
893  return *m_opaque_sp.get();
894 }
895 
896 namespace lldb_private {
897 namespace repro {
898 
899 template <>
903  LLDB_REGISTER_METHOD(bool, SBType, operator==,(lldb::SBType &));
904  LLDB_REGISTER_METHOD(bool, SBType, operator!=,(lldb::SBType &));
906  SBType, operator=,(const lldb::SBType &));
908  LLDB_REGISTER_METHOD_CONST(bool, SBType, operator bool, ());
909  LLDB_REGISTER_METHOD(uint64_t, SBType, GetByteSize, ());
910  LLDB_REGISTER_METHOD(bool, SBType, IsPointerType, ());
911  LLDB_REGISTER_METHOD(bool, SBType, IsArrayType, ());
912  LLDB_REGISTER_METHOD(bool, SBType, IsVectorType, ());
913  LLDB_REGISTER_METHOD(bool, SBType, IsReferenceType, ());
914  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetPointerType, ());
915  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetPointeeType, ());
916  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetReferenceType, ());
917  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetTypedefedType, ());
918  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetDereferencedType, ());
919  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetArrayElementType, ());
920  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetArrayType, (uint64_t));
921  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetVectorElementType, ());
922  LLDB_REGISTER_METHOD(bool, SBType, IsFunctionType, ());
923  LLDB_REGISTER_METHOD(bool, SBType, IsPolymorphicClass, ());
924  LLDB_REGISTER_METHOD(bool, SBType, IsTypedefType, ());
925  LLDB_REGISTER_METHOD(bool, SBType, IsAnonymousType, ());
926  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetFunctionReturnType, ());
927  LLDB_REGISTER_METHOD(lldb::SBTypeList, SBType, GetFunctionArgumentTypes,
928  ());
929  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfMemberFunctions, ());
931  GetMemberFunctionAtIndex, (uint32_t));
932  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetUnqualifiedType, ());
933  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetCanonicalType, ());
934  LLDB_REGISTER_METHOD(lldb::BasicType, SBType, GetBasicType, ());
936  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfDirectBaseClasses, ());
937  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfVirtualBaseClasses, ());
938  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfFields, ());
941  LLDB_REGISTER_METHOD(lldb::SBTypeMember, SBType, GetDirectBaseClassAtIndex,
942  (uint32_t));
943  LLDB_REGISTER_METHOD(lldb::SBTypeMember, SBType, GetVirtualBaseClassAtIndex,
944  (uint32_t));
946  ());
948  (uint32_t));
949  LLDB_REGISTER_METHOD(bool, SBType, IsTypeComplete, ());
950  LLDB_REGISTER_METHOD(uint32_t, SBType, GetTypeFlags, ());
951  LLDB_REGISTER_METHOD(const char *, SBType, GetName, ());
952  LLDB_REGISTER_METHOD(const char *, SBType, GetDisplayTypeName, ());
953  LLDB_REGISTER_METHOD(lldb::TypeClass, SBType, GetTypeClass, ());
954  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfTemplateArguments, ());
955  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetTemplateArgumentType,
956  (uint32_t));
958  GetTemplateArgumentKind, (uint32_t));
962  LLDB_REGISTER_METHOD_CONST(bool, SBTypeList, operator bool, ());
964  SBTypeList, operator=,(const lldb::SBTypeList &));
965  LLDB_REGISTER_METHOD(void, SBTypeList, Append, (lldb::SBType));
971  SBTypeMember, operator=,(const lldb::SBTypeMember &));
973  LLDB_REGISTER_METHOD_CONST(bool, SBTypeMember, operator bool, ());
974  LLDB_REGISTER_METHOD(const char *, SBTypeMember, GetName, ());
976  LLDB_REGISTER_METHOD(uint64_t, SBTypeMember, GetOffsetInBytes, ());
977  LLDB_REGISTER_METHOD(uint64_t, SBTypeMember, GetOffsetInBits, ());
978  LLDB_REGISTER_METHOD(bool, SBTypeMember, IsBitfield, ());
979  LLDB_REGISTER_METHOD(uint32_t, SBTypeMember, GetBitfieldSizeInBits, ());
984  (const lldb::SBTypeMemberFunction &));
987  SBTypeMemberFunction, operator=,(const lldb::SBTypeMemberFunction &));
989  LLDB_REGISTER_METHOD_CONST(bool, SBTypeMemberFunction, operator bool, ());
992  ());
994  ());
998  ());
1002  GetKind, ());
1005 }
1006 
1007 }
1008 }
lldb_private::TypeMemberImpl & ref()
Definition: SBType.cpp:745
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:61
The registry contains a unique mapping between functions and their ID.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:94
bool IsReferenceType()
Definition: SBType.cpp:156
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:430
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
Definition: SBType.cpp:637
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:364
bool IsTypeComplete()
Definition: SBType.cpp:480
const char * GetName()
Definition: SBType.cpp:496
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:512
void reset(lldb_private::TypeMemberImpl *)
Definition: SBType.cpp:741
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:285
lldb::SBType GetPointeeType()
Definition: SBType.cpp:174
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:453
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:882
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:101
uint64_t GetByteSize()
Definition: SBType.cpp:121
uint32_t GetTypeFlags()
Definition: SBType.cpp:488
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:82
const char * GetMangledName()
Definition: SBType.cpp:809
void RegisterMethods< SBType >(Registry &R)
Definition: SBType.cpp:900
const char * GetName()
Definition: SBType.cpp:787
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:868
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:766
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:585
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:329
const char * GetDemangledName()
Definition: SBType.cpp:795
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:309
uint64_t GetOffsetInBytes()
Definition: SBType.cpp:676
void Append(lldb::SBType type)
Definition: SBType.cpp:598
lldb::SBType GetReferenceType()
Definition: SBType.cpp:183
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Definition: SBType.cpp:553
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:859
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:52
lldb::SBType GetType()
Definition: SBType.cpp:818
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
uint32_t GetSize()
Definition: SBType.cpp:614
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:201
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:273
bool IsPointerType()
Definition: SBType.cpp:131
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:396
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
bool IsPolymorphicClass()
Definition: SBType.cpp:249
lldb::SBType GetType()
Definition: SBType.cpp:666
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:838
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:76
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:219
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:886
size_t GetNumberOfFunctionArguments() const
lldb::SBType GetPointerType()
Definition: SBType.cpp:164
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:380
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:64
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:106
uint32_t GetBitfieldSizeInBits()
Definition: SBType.cpp:700
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:320
lldb_private::Stream & ref()
Definition: SBStream.cpp:162
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:847
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:528
void Append(SBTypeEnumMember entry)
uint64_t GetOffsetInBits()
Definition: SBType.cpp:684
bool IsAnonymousType()
Definition: SBType.cpp:265
lldb::BasicType GetBasicType()
Definition: SBType.cpp:338
const char * GetDisplayTypeName()
Definition: SBType.cpp:504
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:210
A uniqued constant string class.
Definition: ConstString.h:38
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:708
bool IsValid()
Definition: SBType.cpp:575
uint32_t GetNumberOfFields()
Definition: SBType.cpp:372
class LLDB_API SBType
Definition: SBDefines.h:78
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:228
Definition: SBAddress.h:15
bool IsValid() const
Definition: SBType.cpp:648
bool IsArrayType()
Definition: SBType.cpp:139
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:520
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:300
bool IsVectorType()
Definition: SBType.cpp:148
bool IsValid() const
Definition: SBType.cpp:108
lldb::SBType GetReturnType()
Definition: SBType.cpp:828
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:356
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:192
const char * GetName()
Definition: SBType.cpp:658
bool IsFunctionType()
Definition: SBType.cpp:241
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:216
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:413
#define LLDB_RECORD_RESULT(Result)
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:78
bool IsTypedefType()
Definition: SBType.cpp:257
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:56
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
void SetCString(const char *cstr)
Set the C string value.
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:605