Go to the documentation of this file.
22 #include "llvm/ADT/APSInt.h"
33 CompilerType(type.GetTypeSystem(), type.GetOpaqueQualType()))) {}
36 : m_opaque_sp(new
TypeImpl(type_sp)) {}
39 : m_opaque_sp(type_impl_sp) {}
110 return this->
operator bool();
112 SBType::operator bool()
const {
115 if (m_opaque_sp.get() ==
nullptr)
118 return m_opaque_sp->IsValid();
125 if (llvm::Optional<uint64_t> size =
126 m_opaque_sp->GetCompilerType(
false).GetByteSize(
nullptr))
136 return m_opaque_sp->GetCompilerType(
true).IsPointerType();
144 return m_opaque_sp->GetCompilerType(
true).IsArrayType(
nullptr,
nullptr,
153 return m_opaque_sp->GetCompilerType(
true).IsVectorType(
nullptr,
nullptr);
161 return m_opaque_sp->GetCompilerType(
true).IsReferenceType();
211 m_opaque_sp->GetCompilerType(
true).GetArrayElementType(
nullptr))));
229 if (
m_opaque_sp->GetCompilerType(
true).IsVectorType(&vector_element_type,
231 type_sb.
SetSP(TypeImplSP(
new TypeImpl(vector_element_type)));
241 return m_opaque_sp->GetCompilerType(
true).IsFunctionType();
249 return m_opaque_sp->GetCompilerType(
true).IsPolymorphicClass();
257 return m_opaque_sp->GetCompilerType(
true).IsTypedefType();
265 return m_opaque_sp->GetCompilerType(
true).IsAnonymousType();
273 return m_opaque_sp->GetCompilerType(
true).IsScopedEnumerationType();
281 return m_opaque_sp->GetCompilerType(
true).IsAggregateType();
289 m_opaque_sp->GetCompilerType(
true).GetFunctionReturnType());
291 return SBType(return_type);
303 for (
size_t i = 0; i < count; i++) {
314 return m_opaque_sp->GetCompilerType(
true).GetNumMemberFunctions();
325 m_opaque_sp->GetCompilerType(
true).GetMemberFunctionAtIndex(idx)));
350 m_opaque_sp->GetCompilerType(
true).GetEnumerationIntegerType());
359 return m_opaque_sp->GetCompilerType(
false).GetBasicTypeEnumeration();
368 m_opaque_sp->GetTypeSystem(
false)->GetBasicTypeFromAST(basic_type));
376 return m_opaque_sp->GetCompilerType(
true).GetNumDirectBaseClasses();
384 return m_opaque_sp->GetCompilerType(
true).GetNumVirtualBaseClasses();
392 return m_opaque_sp->GetCompilerType(
true).GetNumFields();
403 m_opaque_sp->GetDescription(strm, description_level);
417 m_opaque_sp->GetCompilerType(
true).GetDirectBaseClassAtIndex(
421 TypeImplSP(
new TypeImpl(base_class_type)), bit_offset));
423 return sb_type_member;
433 m_opaque_sp->GetCompilerType(
true).GetVirtualBaseClassAtIndex(
437 TypeImplSP(
new TypeImpl(base_class_type)), bit_offset));
439 return sb_type_member;
452 const llvm::APSInt &value) ->
bool {
455 lldb::TypeImplSP(
new TypeImpl(integer_type)), name, value)));
456 sb_enum_member_list.
Append(enum_member);
461 return sb_enum_member_list;
471 uint64_t bit_offset = 0;
473 bool is_bitfield =
false;
476 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
479 if (!name_sstr.empty())
481 sb_type_member.
reset(
483 name, bitfield_bit_size, is_bitfield));
487 return sb_type_member;
495 return m_opaque_sp->GetCompilerType(
false).IsCompleteType();
503 return m_opaque_sp->GetCompilerType(
true).GetTypeInfo();
530 return m_opaque_sp->GetDisplayTypeName().GetCString();
537 return m_opaque_sp->GetCompilerType(
true).GetTypeClass();
538 return lldb::eTypeClassInvalid;
545 return m_opaque_sp->GetCompilerType(
false).GetNumTemplateArguments();
558 type =
m_opaque_sp->GetCompilerType(
false).GetTypeTemplateArgument(idx);
562 .GetIntegralTemplateArgument(idx)
577 return m_opaque_sp->GetCompilerType(
false).GetTemplateArgumentKind(idx);
596 return this->
operator bool();
598 SBTypeList::operator bool()
const {
601 return (m_opaque_up !=
nullptr);
664 return this->
operator bool();
666 SBTypeMember::operator bool()
const {
669 return m_opaque_up.get();
730 const uint32_t byte_offset = bit_offset / 8u;
731 const uint32_t byte_bit_offset = bit_offset % 8u;
732 const char *name =
m_opaque_up->GetName().GetCString();
734 strm.
Printf(
"+%u + %u bits: (", byte_offset, byte_bit_offset);
736 strm.
Printf(
"+%u: (", byte_offset);
738 TypeImplSP type_impl_sp(
m_opaque_up->GetTypeImpl());
740 type_impl_sp->GetDescription(strm, description_level);
742 strm.
Printf(
") %s", name);
745 strm.
Printf(
" : %u", bitfield_bit_size);
770 : m_opaque_sp(rhs.m_opaque_sp) {
785 return this->
operator bool();
787 SBTypeMemberFunction::operator bool()
const {
790 return m_opaque_sp.get();
807 Mangled mangled(mangled_str);
808 return mangled.GetDemangledName().GetCString();
887 m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
lldb::SBType GetTypeAtIndex(uint32_t index)
uint32_t GetNumberOfArguments()
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
lldb_private::Stream & ref()
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
lldb::SBType GetReferenceType()
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
bool operator==(lldb::SBType &rhs)
lldb::TypeImplSP m_opaque_sp
lldb::SBType & operator=(const lldb::SBType &rhs)
uint32_t GetNumberOfDirectBaseClasses()
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
uint32_t GetBitfieldSizeInBits()
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
void SetCString(const char *cstr)
Set the C string value.
lldb::SBType GetArrayType(uint64_t size)
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
uint32_t GetNumberOfTemplateArguments()
@ eTemplateArgumentKindType
uint32_t GetNumberOfMemberFunctions()
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
lldb::SBType GetReturnType()
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::SBType GetTemplateArgumentType(uint32_t idx)
lldb::SBType GetDereferencedType()
void reset(lldb_private::TypeMemberImpl *)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
void SetSP(const ModuleSP &module_sp)
lldb::SBType GetPointeeType()
lldb::TypeClass GetTypeClass()
lldb::SBType GetUnqualifiedType()
size_t GetNumberOfFunctionArguments() const
lldb::SBModule GetModule()
lldb::SBTypeList GetFunctionArgumentTypes()
const char * GetDisplayTypeName()
string(SUBSTRING ${p} 10 -1 pStripped) if($
uint32_t GetNumberOfFields()
bool operator!=(lldb::SBType &rhs)
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
lldb_private::TypeImpl & ref()
lldb_private::TypeMemberFunctionImpl & ref()
void Append(SBTypeEnumMember entry)
lldb::SBType GetFunctionReturnType()
bool IsPolymorphicClass()
@ eTemplateArgumentKindNull
lldb_private::TypeMemberImpl & ref()
void reset(lldb_private::TypeMemberFunctionImpl *)
lldb::SBType GetPointerType()
lldb::MemberFunctionKind GetKind()
bool IsScopedEnumerationType()
uint32_t GetNumberOfVirtualBaseClasses()
Generic representation of a type in a programming language.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::SBType GetTypedefedType()
A class that represents a running process on the host machine.
lldb::SBType GetEnumerationIntegerType()
#define LLDB_INSTRUMENT_VA(...)
lldb::SBType GetCanonicalType()
lldb::BasicType GetBasicType()
lldb::SBType GetArrayElementType()
MemberFunctionKind
Kind of member function.
void Append(lldb::SBType type)
const char * GetMangledName()
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
@ eTemplateArgumentKindIntegral
lldb::SBTypeEnumMemberList GetEnumMembers()
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
lldb::SBType GetVectorElementType()
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
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.
lldb::TypeMemberFunctionImplSP m_opaque_sp
void SetSP(const lldb::TypeImplSP &type_impl_sp)
uint64_t GetOffsetInBits()
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
uint64_t GetOffsetInBytes()
const char * GetDemangledName()