1 //===-- SBType.cpp --------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "lldb/API/SBType.h"
10 #include "lldb/API/SBDefines.h"
11 #include "lldb/API/SBModule.h"
12 #include "lldb/API/SBStream.h"
13 #include "lldb/API/SBTypeEnumMember.h"
14 #include "lldb/Core/Mangled.h"
15 #include "lldb/Symbol/CompilerType.h"
16 #include "lldb/Symbol/Type.h"
17 #include "lldb/Symbol/TypeSystem.h"
18 #include "lldb/Utility/ConstString.h"
19 #include "lldb/Utility/Instrumentation.h"
20 #include "lldb/Utility/Stream.h"
22 #include "llvm/ADT/APSInt.h"
28 using namespace lldb_private
;
30 SBType::SBType() { LLDB_INSTRUMENT_VA(this); }
32 SBType::SBType(const CompilerType
&type
) : m_opaque_sp(new TypeImpl(type
)) {}
34 SBType::SBType(const lldb::TypeSP
&type_sp
)
35 : m_opaque_sp(new TypeImpl(type_sp
)) {}
37 SBType::SBType(const lldb::TypeImplSP
&type_impl_sp
)
38 : m_opaque_sp(type_impl_sp
) {}
40 SBType::SBType(const SBType
&rhs
) {
41 LLDB_INSTRUMENT_VA(this, rhs
);
44 m_opaque_sp
= rhs
.m_opaque_sp
;
48 // SBType::SBType (TypeImpl* impl) :
52 bool SBType::operator==(SBType
&rhs
) {
53 LLDB_INSTRUMENT_VA(this, rhs
);
56 return !rhs
.IsValid();
61 return *m_opaque_sp
.get() == *rhs
.m_opaque_sp
.get();
64 bool SBType::operator!=(SBType
&rhs
) {
65 LLDB_INSTRUMENT_VA(this, rhs
);
73 return *m_opaque_sp
.get() != *rhs
.m_opaque_sp
.get();
76 lldb::TypeImplSP
SBType::GetSP() { return m_opaque_sp
; }
78 void SBType::SetSP(const lldb::TypeImplSP
&type_impl_sp
) {
79 m_opaque_sp
= type_impl_sp
;
82 SBType
&SBType::operator=(const SBType
&rhs
) {
83 LLDB_INSTRUMENT_VA(this, rhs
);
86 m_opaque_sp
= rhs
.m_opaque_sp
;
91 SBType::~SBType() = default;
93 TypeImpl
&SBType::ref() {
94 if (m_opaque_sp
.get() == nullptr)
95 m_opaque_sp
= std::make_shared
<TypeImpl
>();
99 const TypeImpl
&SBType::ref() const {
100 // "const SBAddress &addr" should already have checked "addr.IsValid()" prior
101 // to calling this function. In case you didn't we will assert and die to let
103 assert(m_opaque_sp
.get());
107 bool SBType::IsValid() const {
108 LLDB_INSTRUMENT_VA(this);
109 return this->operator bool();
111 SBType::operator bool() const {
112 LLDB_INSTRUMENT_VA(this);
114 if (m_opaque_sp
.get() == nullptr)
117 return m_opaque_sp
->IsValid();
120 uint64_t SBType::GetByteSize() {
121 LLDB_INSTRUMENT_VA(this);
124 if (std::optional
<uint64_t> size
=
125 m_opaque_sp
->GetCompilerType(false).GetByteSize(nullptr))
130 bool SBType::IsPointerType() {
131 LLDB_INSTRUMENT_VA(this);
135 return m_opaque_sp
->GetCompilerType(true).IsPointerType();
138 bool SBType::IsArrayType() {
139 LLDB_INSTRUMENT_VA(this);
143 return m_opaque_sp
->GetCompilerType(true).IsArrayType(nullptr, nullptr,
147 bool SBType::IsVectorType() {
148 LLDB_INSTRUMENT_VA(this);
152 return m_opaque_sp
->GetCompilerType(true).IsVectorType(nullptr, nullptr);
155 bool SBType::IsReferenceType() {
156 LLDB_INSTRUMENT_VA(this);
160 return m_opaque_sp
->GetCompilerType(true).IsReferenceType();
163 SBType
SBType::GetPointerType() {
164 LLDB_INSTRUMENT_VA(this);
169 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetPointerType())));
172 SBType
SBType::GetPointeeType() {
173 LLDB_INSTRUMENT_VA(this);
177 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetPointeeType())));
180 SBType
SBType::GetReferenceType() {
181 LLDB_INSTRUMENT_VA(this);
185 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetReferenceType())));
188 SBType
SBType::GetTypedefedType() {
189 LLDB_INSTRUMENT_VA(this);
193 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetTypedefedType())));
196 SBType
SBType::GetDereferencedType() {
197 LLDB_INSTRUMENT_VA(this);
201 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetDereferencedType())));
204 SBType
SBType::GetArrayElementType() {
205 LLDB_INSTRUMENT_VA(this);
209 return SBType(TypeImplSP(new TypeImpl(
210 m_opaque_sp
->GetCompilerType(true).GetArrayElementType(nullptr))));
213 SBType
SBType::GetArrayType(uint64_t size
) {
214 LLDB_INSTRUMENT_VA(this, size
);
218 return SBType(TypeImplSP(
219 new TypeImpl(m_opaque_sp
->GetCompilerType(true).GetArrayType(size
))));
222 SBType
SBType::GetVectorElementType() {
223 LLDB_INSTRUMENT_VA(this);
227 CompilerType vector_element_type
;
228 if (m_opaque_sp
->GetCompilerType(true).IsVectorType(&vector_element_type
,
230 type_sb
.SetSP(TypeImplSP(new TypeImpl(vector_element_type
)));
235 bool SBType::IsFunctionType() {
236 LLDB_INSTRUMENT_VA(this);
240 return m_opaque_sp
->GetCompilerType(true).IsFunctionType();
243 bool SBType::IsPolymorphicClass() {
244 LLDB_INSTRUMENT_VA(this);
248 return m_opaque_sp
->GetCompilerType(true).IsPolymorphicClass();
251 bool SBType::IsTypedefType() {
252 LLDB_INSTRUMENT_VA(this);
256 return m_opaque_sp
->GetCompilerType(true).IsTypedefType();
259 bool SBType::IsAnonymousType() {
260 LLDB_INSTRUMENT_VA(this);
264 return m_opaque_sp
->GetCompilerType(true).IsAnonymousType();
267 bool SBType::IsScopedEnumerationType() {
268 LLDB_INSTRUMENT_VA(this);
272 return m_opaque_sp
->GetCompilerType(true).IsScopedEnumerationType();
275 bool SBType::IsAggregateType() {
276 LLDB_INSTRUMENT_VA(this);
280 return m_opaque_sp
->GetCompilerType(true).IsAggregateType();
283 lldb::SBType
SBType::GetFunctionReturnType() {
284 LLDB_INSTRUMENT_VA(this);
287 CompilerType
return_type(
288 m_opaque_sp
->GetCompilerType(true).GetFunctionReturnType());
289 if (return_type
.IsValid())
290 return SBType(return_type
);
292 return lldb::SBType();
295 lldb::SBTypeList
SBType::GetFunctionArgumentTypes() {
296 LLDB_INSTRUMENT_VA(this);
298 SBTypeList sb_type_list
;
300 CompilerType
func_type(m_opaque_sp
->GetCompilerType(true));
301 size_t count
= func_type
.GetNumberOfFunctionArguments();
302 for (size_t i
= 0; i
< count
; i
++) {
303 sb_type_list
.Append(SBType(func_type
.GetFunctionArgumentAtIndex(i
)));
309 uint32_t SBType::GetNumberOfMemberFunctions() {
310 LLDB_INSTRUMENT_VA(this);
313 return m_opaque_sp
->GetCompilerType(true).GetNumMemberFunctions();
318 lldb::SBTypeMemberFunction
SBType::GetMemberFunctionAtIndex(uint32_t idx
) {
319 LLDB_INSTRUMENT_VA(this, idx
);
321 SBTypeMemberFunction sb_func_type
;
323 sb_func_type
.reset(new TypeMemberFunctionImpl(
324 m_opaque_sp
->GetCompilerType(true).GetMemberFunctionAtIndex(idx
)));
328 lldb::SBType
SBType::GetUnqualifiedType() {
329 LLDB_INSTRUMENT_VA(this);
333 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetUnqualifiedType())));
336 lldb::SBType
SBType::GetCanonicalType() {
337 LLDB_INSTRUMENT_VA(this);
340 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp
->GetCanonicalType())));
344 SBType
SBType::GetEnumerationIntegerType() {
345 LLDB_INSTRUMENT_VA(this);
349 m_opaque_sp
->GetCompilerType(true).GetEnumerationIntegerType());
354 lldb::BasicType
SBType::GetBasicType() {
355 LLDB_INSTRUMENT_VA(this);
358 return m_opaque_sp
->GetCompilerType(false).GetBasicTypeEnumeration();
359 return eBasicTypeInvalid
;
362 SBType
SBType::GetBasicType(lldb::BasicType basic_type
) {
363 LLDB_INSTRUMENT_VA(this, basic_type
);
365 if (IsValid() && m_opaque_sp
->IsValid())
366 if (auto ts
= m_opaque_sp
->GetTypeSystem(false))
367 return SBType(ts
->GetBasicTypeFromAST(basic_type
));
371 uint32_t SBType::GetNumberOfDirectBaseClasses() {
372 LLDB_INSTRUMENT_VA(this);
375 return m_opaque_sp
->GetCompilerType(true).GetNumDirectBaseClasses();
379 uint32_t SBType::GetNumberOfVirtualBaseClasses() {
380 LLDB_INSTRUMENT_VA(this);
383 return m_opaque_sp
->GetCompilerType(true).GetNumVirtualBaseClasses();
387 uint32_t SBType::GetNumberOfFields() {
388 LLDB_INSTRUMENT_VA(this);
391 return m_opaque_sp
->GetCompilerType(true).GetNumFields();
395 bool SBType::GetDescription(SBStream
&description
,
396 lldb::DescriptionLevel description_level
) {
397 LLDB_INSTRUMENT_VA(this, description
, description_level
);
399 Stream
&strm
= description
.ref();
402 m_opaque_sp
->GetDescription(strm
, description_level
);
404 strm
.PutCString("No value");
409 SBTypeMember
SBType::GetDirectBaseClassAtIndex(uint32_t idx
) {
410 LLDB_INSTRUMENT_VA(this, idx
);
412 SBTypeMember sb_type_member
;
414 uint32_t bit_offset
= 0;
415 CompilerType base_class_type
=
416 m_opaque_sp
->GetCompilerType(true).GetDirectBaseClassAtIndex(
418 if (base_class_type
.IsValid())
419 sb_type_member
.reset(new TypeMemberImpl(
420 TypeImplSP(new TypeImpl(base_class_type
)), bit_offset
));
422 return sb_type_member
;
425 SBTypeMember
SBType::GetVirtualBaseClassAtIndex(uint32_t idx
) {
426 LLDB_INSTRUMENT_VA(this, idx
);
428 SBTypeMember sb_type_member
;
430 uint32_t bit_offset
= 0;
431 CompilerType base_class_type
=
432 m_opaque_sp
->GetCompilerType(true).GetVirtualBaseClassAtIndex(
434 if (base_class_type
.IsValid())
435 sb_type_member
.reset(new TypeMemberImpl(
436 TypeImplSP(new TypeImpl(base_class_type
)), bit_offset
));
438 return sb_type_member
;
441 SBTypeEnumMemberList
SBType::GetEnumMembers() {
442 LLDB_INSTRUMENT_VA(this);
444 SBTypeEnumMemberList sb_enum_member_list
;
446 CompilerType
this_type(m_opaque_sp
->GetCompilerType(true));
447 if (this_type
.IsValid()) {
448 this_type
.ForEachEnumerator([&sb_enum_member_list
](
449 const CompilerType
&integer_type
,
451 const llvm::APSInt
&value
) -> bool {
452 SBTypeEnumMember
enum_member(
453 lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
454 lldb::TypeImplSP(new TypeImpl(integer_type
)), name
, value
)));
455 sb_enum_member_list
.Append(enum_member
);
456 return true; // Keep iterating
460 return sb_enum_member_list
;
463 SBTypeMember
SBType::GetFieldAtIndex(uint32_t idx
) {
464 LLDB_INSTRUMENT_VA(this, idx
);
466 SBTypeMember sb_type_member
;
468 CompilerType
this_type(m_opaque_sp
->GetCompilerType(false));
469 if (this_type
.IsValid()) {
470 uint64_t bit_offset
= 0;
471 uint32_t bitfield_bit_size
= 0;
472 bool is_bitfield
= false;
473 std::string name_sstr
;
474 CompilerType
field_type(this_type
.GetFieldAtIndex(
475 idx
, name_sstr
, &bit_offset
, &bitfield_bit_size
, &is_bitfield
));
476 if (field_type
.IsValid()) {
478 if (!name_sstr
.empty())
479 name
.SetCString(name_sstr
.c_str());
480 sb_type_member
.reset(
481 new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type
)), bit_offset
,
482 name
, bitfield_bit_size
, is_bitfield
));
486 return sb_type_member
;
489 bool SBType::IsTypeComplete() {
490 LLDB_INSTRUMENT_VA(this);
494 CompilerType compiler_type
= m_opaque_sp
->GetCompilerType(false);
495 // Only return true if we have a complete type and it wasn't forcefully
497 if (compiler_type
.IsCompleteType())
498 return !compiler_type
.IsForcefullyCompleted();
502 uint32_t SBType::GetTypeFlags() {
503 LLDB_INSTRUMENT_VA(this);
507 return m_opaque_sp
->GetCompilerType(true).GetTypeInfo();
510 lldb::SBModule
SBType::GetModule() {
511 LLDB_INSTRUMENT_VA(this);
513 lldb::SBModule sb_module
;
517 sb_module
.SetSP(m_opaque_sp
->GetModule());
521 const char *SBType::GetName() {
522 LLDB_INSTRUMENT_VA(this);
526 return m_opaque_sp
->GetName().GetCString();
529 const char *SBType::GetDisplayTypeName() {
530 LLDB_INSTRUMENT_VA(this);
534 return m_opaque_sp
->GetDisplayTypeName().GetCString();
537 lldb::TypeClass
SBType::GetTypeClass() {
538 LLDB_INSTRUMENT_VA(this);
541 return m_opaque_sp
->GetCompilerType(true).GetTypeClass();
542 return lldb::eTypeClassInvalid
;
545 uint32_t SBType::GetNumberOfTemplateArguments() {
546 LLDB_INSTRUMENT_VA(this);
549 return m_opaque_sp
->GetCompilerType(false).GetNumTemplateArguments(
550 /*expand_pack=*/true);
554 lldb::SBType
SBType::GetTemplateArgumentType(uint32_t idx
) {
555 LLDB_INSTRUMENT_VA(this, idx
);
561 const bool expand_pack
= true;
562 switch(GetTemplateArgumentKind(idx
)) {
563 case eTemplateArgumentKindType
:
564 type
= m_opaque_sp
->GetCompilerType(false).GetTypeTemplateArgument(
567 case eTemplateArgumentKindIntegral
:
568 type
= m_opaque_sp
->GetCompilerType(false)
569 .GetIntegralTemplateArgument(idx
, expand_pack
)
580 lldb::TemplateArgumentKind
SBType::GetTemplateArgumentKind(uint32_t idx
) {
581 LLDB_INSTRUMENT_VA(this, idx
);
584 return m_opaque_sp
->GetCompilerType(false).GetTemplateArgumentKind(
585 idx
, /*expand_pack=*/true);
586 return eTemplateArgumentKindNull
;
589 SBType
SBType::FindDirectNestedType(const char *name
) {
590 LLDB_INSTRUMENT_VA(this, name
);
594 return SBType(m_opaque_sp
->FindDirectNestedType(name
));
597 SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {
598 LLDB_INSTRUMENT_VA(this);
601 SBTypeList::SBTypeList(const SBTypeList
&rhs
)
602 : m_opaque_up(new TypeListImpl()) {
603 LLDB_INSTRUMENT_VA(this, rhs
);
605 for (uint32_t i
= 0, rhs_size
= const_cast<SBTypeList
&>(rhs
).GetSize();
607 Append(const_cast<SBTypeList
&>(rhs
).GetTypeAtIndex(i
));
610 bool SBTypeList::IsValid() {
611 LLDB_INSTRUMENT_VA(this);
612 return this->operator bool();
614 SBTypeList::operator bool() const {
615 LLDB_INSTRUMENT_VA(this);
617 return (m_opaque_up
!= nullptr);
620 SBTypeList
&SBTypeList::operator=(const SBTypeList
&rhs
) {
621 LLDB_INSTRUMENT_VA(this, rhs
);
624 m_opaque_up
= std::make_unique
<TypeListImpl
>();
625 for (uint32_t i
= 0, rhs_size
= const_cast<SBTypeList
&>(rhs
).GetSize();
627 Append(const_cast<SBTypeList
&>(rhs
).GetTypeAtIndex(i
));
632 void SBTypeList::Append(SBType type
) {
633 LLDB_INSTRUMENT_VA(this, type
);
636 m_opaque_up
->Append(type
.m_opaque_sp
);
639 SBType
SBTypeList::GetTypeAtIndex(uint32_t index
) {
640 LLDB_INSTRUMENT_VA(this, index
);
643 return SBType(m_opaque_up
->GetTypeAtIndex(index
));
647 uint32_t SBTypeList::GetSize() {
648 LLDB_INSTRUMENT_VA(this);
650 return m_opaque_up
->GetSize();
653 SBTypeList::~SBTypeList() = default;
655 SBTypeMember::SBTypeMember() { LLDB_INSTRUMENT_VA(this); }
657 SBTypeMember::~SBTypeMember() = default;
659 SBTypeMember::SBTypeMember(const SBTypeMember
&rhs
) {
660 LLDB_INSTRUMENT_VA(this, rhs
);
664 m_opaque_up
= std::make_unique
<TypeMemberImpl
>(rhs
.ref());
668 lldb::SBTypeMember
&SBTypeMember::operator=(const lldb::SBTypeMember
&rhs
) {
669 LLDB_INSTRUMENT_VA(this, rhs
);
673 m_opaque_up
= std::make_unique
<TypeMemberImpl
>(rhs
.ref());
678 bool SBTypeMember::IsValid() const {
679 LLDB_INSTRUMENT_VA(this);
680 return this->operator bool();
682 SBTypeMember::operator bool() const {
683 LLDB_INSTRUMENT_VA(this);
685 return m_opaque_up
.get();
688 const char *SBTypeMember::GetName() {
689 LLDB_INSTRUMENT_VA(this);
692 return m_opaque_up
->GetName().GetCString();
696 SBType
SBTypeMember::GetType() {
697 LLDB_INSTRUMENT_VA(this);
701 sb_type
.SetSP(m_opaque_up
->GetTypeImpl());
706 uint64_t SBTypeMember::GetOffsetInBytes() {
707 LLDB_INSTRUMENT_VA(this);
710 return m_opaque_up
->GetBitOffset() / 8u;
714 uint64_t SBTypeMember::GetOffsetInBits() {
715 LLDB_INSTRUMENT_VA(this);
718 return m_opaque_up
->GetBitOffset();
722 bool SBTypeMember::IsBitfield() {
723 LLDB_INSTRUMENT_VA(this);
726 return m_opaque_up
->GetIsBitfield();
730 uint32_t SBTypeMember::GetBitfieldSizeInBits() {
731 LLDB_INSTRUMENT_VA(this);
734 return m_opaque_up
->GetBitfieldBitSize();
738 bool SBTypeMember::GetDescription(lldb::SBStream
&description
,
739 lldb::DescriptionLevel description_level
) {
740 LLDB_INSTRUMENT_VA(this, description
, description_level
);
742 Stream
&strm
= description
.ref();
745 const uint32_t bit_offset
= m_opaque_up
->GetBitOffset();
746 const uint32_t byte_offset
= bit_offset
/ 8u;
747 const uint32_t byte_bit_offset
= bit_offset
% 8u;
748 const char *name
= m_opaque_up
->GetName().GetCString();
750 strm
.Printf("+%u + %u bits: (", byte_offset
, byte_bit_offset
);
752 strm
.Printf("+%u: (", byte_offset
);
754 TypeImplSP
type_impl_sp(m_opaque_up
->GetTypeImpl());
756 type_impl_sp
->GetDescription(strm
, description_level
);
758 strm
.Printf(") %s", name
);
759 if (m_opaque_up
->GetIsBitfield()) {
760 const uint32_t bitfield_bit_size
= m_opaque_up
->GetBitfieldBitSize();
761 strm
.Printf(" : %u", bitfield_bit_size
);
764 strm
.PutCString("No value");
769 void SBTypeMember::reset(TypeMemberImpl
*type_member_impl
) {
770 m_opaque_up
.reset(type_member_impl
);
773 TypeMemberImpl
&SBTypeMember::ref() {
774 if (m_opaque_up
== nullptr)
775 m_opaque_up
= std::make_unique
<TypeMemberImpl
>();
779 const TypeMemberImpl
&SBTypeMember::ref() const { return *m_opaque_up
; }
781 SBTypeMemberFunction::SBTypeMemberFunction() { LLDB_INSTRUMENT_VA(this); }
783 SBTypeMemberFunction::~SBTypeMemberFunction() = default;
785 SBTypeMemberFunction::SBTypeMemberFunction(const SBTypeMemberFunction
&rhs
)
786 : m_opaque_sp(rhs
.m_opaque_sp
) {
787 LLDB_INSTRUMENT_VA(this, rhs
);
790 lldb::SBTypeMemberFunction
&SBTypeMemberFunction::
791 operator=(const lldb::SBTypeMemberFunction
&rhs
) {
792 LLDB_INSTRUMENT_VA(this, rhs
);
795 m_opaque_sp
= rhs
.m_opaque_sp
;
799 bool SBTypeMemberFunction::IsValid() const {
800 LLDB_INSTRUMENT_VA(this);
801 return this->operator bool();
803 SBTypeMemberFunction::operator bool() const {
804 LLDB_INSTRUMENT_VA(this);
806 return m_opaque_sp
.get();
809 const char *SBTypeMemberFunction::GetName() {
810 LLDB_INSTRUMENT_VA(this);
813 return m_opaque_sp
->GetName().GetCString();
817 const char *SBTypeMemberFunction::GetDemangledName() {
818 LLDB_INSTRUMENT_VA(this);
823 ConstString mangled_str
= m_opaque_sp
->GetMangledName();
827 Mangled
mangled(mangled_str
);
828 return mangled
.GetDemangledName().GetCString();
831 const char *SBTypeMemberFunction::GetMangledName() {
832 LLDB_INSTRUMENT_VA(this);
835 return m_opaque_sp
->GetMangledName().GetCString();
839 SBType
SBTypeMemberFunction::GetType() {
840 LLDB_INSTRUMENT_VA(this);
844 sb_type
.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp
->GetType())));
849 lldb::SBType
SBTypeMemberFunction::GetReturnType() {
850 LLDB_INSTRUMENT_VA(this);
854 sb_type
.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp
->GetReturnType())));
859 uint32_t SBTypeMemberFunction::GetNumberOfArguments() {
860 LLDB_INSTRUMENT_VA(this);
863 return m_opaque_sp
->GetNumArguments();
867 lldb::SBType
SBTypeMemberFunction::GetArgumentTypeAtIndex(uint32_t i
) {
868 LLDB_INSTRUMENT_VA(this, i
);
873 lldb::TypeImplSP(new TypeImpl(m_opaque_sp
->GetArgumentAtIndex(i
))));
878 lldb::MemberFunctionKind
SBTypeMemberFunction::GetKind() {
879 LLDB_INSTRUMENT_VA(this);
882 return m_opaque_sp
->GetKind();
883 return lldb::eMemberFunctionKindUnknown
;
886 bool SBTypeMemberFunction::GetDescription(
887 lldb::SBStream
&description
, lldb::DescriptionLevel description_level
) {
888 LLDB_INSTRUMENT_VA(this, description
, description_level
);
890 Stream
&strm
= description
.ref();
893 return m_opaque_sp
->GetDescription(strm
);
898 void SBTypeMemberFunction::reset(TypeMemberFunctionImpl
*type_member_impl
) {
899 m_opaque_sp
.reset(type_member_impl
);
902 TypeMemberFunctionImpl
&SBTypeMemberFunction::ref() {
904 m_opaque_sp
= std::make_shared
<TypeMemberFunctionImpl
>();
905 return *m_opaque_sp
.get();
908 const TypeMemberFunctionImpl
&SBTypeMemberFunction::ref() const {
909 return *m_opaque_sp
.get();