22#include "llvm/ADT/APSInt.h"
35 : m_opaque_sp(new
TypeImpl(type_sp)) {}
38 : m_opaque_sp(type_impl_sp) {}
109 return this->
operator bool();
111SBType::operator bool()
const {
114 if (m_opaque_sp.get() ==
nullptr)
117 return m_opaque_sp->IsValid();
124 if (std::optional<uint64_t> size =
125 m_opaque_sp->GetCompilerType(
false).GetByteSize(
nullptr))
135 return m_opaque_sp->GetCompilerType(
true).IsPointerType();
143 return m_opaque_sp->GetCompilerType(
true).IsArrayType(
nullptr,
nullptr,
152 return m_opaque_sp->GetCompilerType(
true).IsVectorType(
nullptr,
nullptr);
160 return m_opaque_sp->GetCompilerType(
true).IsReferenceType();
210 m_opaque_sp->GetCompilerType(
true).GetArrayElementType(
nullptr))));
228 if (
m_opaque_sp->GetCompilerType(
true).IsVectorType(&vector_element_type,
240 return m_opaque_sp->GetCompilerType(
true).IsFunctionType();
248 return m_opaque_sp->GetCompilerType(
true).IsPolymorphicClass();
256 return m_opaque_sp->GetCompilerType(
true).IsTypedefType();
264 return m_opaque_sp->GetCompilerType(
true).IsAnonymousType();
272 return m_opaque_sp->GetCompilerType(
true).IsScopedEnumerationType();
280 return m_opaque_sp->GetCompilerType(
true).IsAggregateType();
288 m_opaque_sp->GetCompilerType(
true).GetFunctionReturnType());
290 return SBType(return_type);
302 for (
size_t i = 0; i < count; i++) {
313 return m_opaque_sp->GetCompilerType(
true).GetNumMemberFunctions();
324 m_opaque_sp->GetCompilerType(
true).GetMemberFunctionAtIndex(idx)));
349 m_opaque_sp->GetCompilerType(
true).GetEnumerationIntegerType());
358 return m_opaque_sp->GetCompilerType(
false).GetBasicTypeEnumeration();
367 return SBType(ts->GetBasicTypeFromAST(basic_type));
375 return m_opaque_sp->GetCompilerType(
true).GetNumDirectBaseClasses();
383 return m_opaque_sp->GetCompilerType(
true).GetNumVirtualBaseClasses();
391 return m_opaque_sp->GetCompilerType(
true).GetNumFields();
402 m_opaque_sp->GetDescription(strm, description_level);
414 uint32_t bit_offset = 0;
416 m_opaque_sp->GetCompilerType(
true).GetDirectBaseClassAtIndex(
422 return sb_type_member;
430 uint32_t bit_offset = 0;
432 m_opaque_sp->GetCompilerType(
true).GetVirtualBaseClassAtIndex(
438 return sb_type_member;
451 const llvm::APSInt &value) ->
bool {
455 sb_enum_member_list.
Append(enum_member);
460 return sb_enum_member_list;
470 uint64_t bit_offset = 0;
471 uint32_t bitfield_bit_size = 0;
472 bool is_bitfield =
false;
473 std::string name_sstr;
475 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
478 if (!name_sstr.empty())
480 sb_type_member.
reset(
482 name, bitfield_bit_size, is_bitfield));
486 return sb_type_member;
507 return m_opaque_sp->GetCompilerType(
true).GetTypeInfo();
534 return m_opaque_sp->GetDisplayTypeName().GetCString();
541 return m_opaque_sp->GetCompilerType(
true).GetTypeClass();
542 return lldb::eTypeClassInvalid;
549 return m_opaque_sp->GetCompilerType(
false).GetNumTemplateArguments(
561 const bool expand_pack =
true;
564 type =
m_opaque_sp->GetCompilerType(
false).GetTypeTemplateArgument(
569 .GetIntegralTemplateArgument(idx, expand_pack)
584 return m_opaque_sp->GetCompilerType(
false).GetTemplateArgumentKind(
604 return this->
operator bool();
606SBTypeList::operator bool()
const {
609 return (m_opaque_up !=
nullptr);
672 return this->
operator bool();
674SBTypeMember::operator bool()
const {
677 return m_opaque_up.get();
737 const uint32_t bit_offset =
m_opaque_up->GetBitOffset();
738 const uint32_t byte_offset = bit_offset / 8u;
739 const uint32_t byte_bit_offset = bit_offset % 8u;
740 const char *name =
m_opaque_up->GetName().GetCString();
742 strm.
Printf(
"+%u + %u bits: (", byte_offset, byte_bit_offset);
744 strm.
Printf(
"+%u: (", byte_offset);
748 type_impl_sp->GetDescription(strm, description_level);
750 strm.
Printf(
") %s", name);
752 const uint32_t bitfield_bit_size =
m_opaque_up->GetBitfieldBitSize();
753 strm.
Printf(
" : %u", bitfield_bit_size);
778 : m_opaque_sp(rhs.m_opaque_sp) {
793 return this->
operator bool();
795SBTypeMemberFunction::operator bool()
const {
798 return m_opaque_sp.get();
896 m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
#define LLDB_INSTRUMENT_VA(...)
void SetSP(const ModuleSP &module_sp)
lldb_private::Stream & ref()
void Append(SBTypeEnumMember entry)
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
lldb::SBType GetTypeAtIndex(uint32_t index)
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
void Append(lldb::SBType type)
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
const char * GetMangledName()
void reset(lldb_private::TypeMemberFunctionImpl *)
lldb::MemberFunctionKind GetKind()
lldb::SBType GetReturnType()
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::TypeMemberFunctionImplSP m_opaque_sp
uint32_t GetNumberOfArguments()
const char * GetDemangledName()
lldb_private::TypeMemberFunctionImpl & ref()
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
void reset(lldb_private::TypeMemberImpl *)
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
uint64_t GetOffsetInBits()
uint64_t GetOffsetInBytes()
uint32_t GetBitfieldSizeInBits()
lldb_private::TypeMemberImpl & ref()
uint32_t GetNumberOfTemplateArguments()
uint32_t GetNumberOfDirectBaseClasses()
lldb::SBType GetReferenceType()
lldb::SBType GetArrayType(uint64_t size)
lldb::SBType GetVectorElementType()
uint32_t GetNumberOfFields()
lldb::SBType GetDereferencedType()
lldb::SBModule GetModule()
lldb::BasicType GetBasicType()
bool IsPolymorphicClass()
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Return the TemplateArgumentKind of the template argument at index idx.
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
lldb::SBType GetPointerType()
uint32_t GetNumberOfMemberFunctions()
lldb::SBType GetTemplateArgumentType(uint32_t idx)
lldb::TypeClass GetTypeClass()
lldb::SBType GetCanonicalType()
bool operator!=(lldb::SBType &rhs)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::SBTypeList GetFunctionArgumentTypes()
uint32_t GetNumberOfVirtualBaseClasses()
lldb::SBType GetTypedefedType()
lldb_private::TypeImpl & ref()
lldb::SBType & operator=(const lldb::SBType &rhs)
lldb::SBType GetFunctionReturnType()
lldb::TypeImplSP m_opaque_sp
lldb::SBType GetUnqualifiedType()
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
const char * GetDisplayTypeName()
lldb::SBType GetArrayElementType()
lldb::SBType GetPointeeType()
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
void SetSP(const lldb::TypeImplSP &type_impl_sp)
bool operator==(lldb::SBType &rhs)
lldb::SBType GetEnumerationIntegerType()
lldb::SBTypeEnumMemberList GetEnumMembers()
bool IsScopedEnumerationType()
Generic representation of a type in a programming language.
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
bool IsCompleteType() const
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
If this type is an enumeration, iterate through all of its enumerators using a callback.
size_t GetNumberOfFunctionArguments() const
bool IsForcefullyCompleted() const
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
const char * GetCString() const
Get the string value as a C string.
A class that handles mangled names.
ConstString GetDemangledName() const
Demangled name get accessor.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
std::shared_ptr< lldb_private::TypeEnumMemberImpl > TypeEnumMemberImplSP
std::shared_ptr< lldb_private::Type > TypeSP
@ eTemplateArgumentKindNull
@ eTemplateArgumentKindIntegral
@ eTemplateArgumentKindType
MemberFunctionKind
Kind of member function.
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP