21 #include "llvm/ADT/APSInt.h" 32 CompilerType(type.GetTypeSystem(), type.GetOpaqueQualType()))) {}
110 return this->
operator bool();
112 SBType::operator bool()
const {
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();
234 if (
m_opaque_sp->GetCompilerType(
true).IsVectorType(&vector_element_type,
236 type_sb.
SetSP(TypeImplSP(
new TypeImpl(vector_element_type)));
246 return m_opaque_sp->GetCompilerType(
true).IsFunctionType();
254 return m_opaque_sp->GetCompilerType(
true).IsPolymorphicClass();
262 return m_opaque_sp->GetCompilerType(
true).IsTypedefType();
270 return m_opaque_sp->GetCompilerType(
true).IsAnonymousType();
278 m_opaque_sp->GetCompilerType(
true).GetFunctionReturnType());
279 if (return_type.IsValid())
293 for (
size_t i = 0; i < count; i++) {
294 sb_type_list.
Append(
SBType(func_type.GetFunctionArgumentAtIndex(i)));
304 return m_opaque_sp->GetCompilerType(
true).GetNumMemberFunctions();
316 m_opaque_sp->GetCompilerType(
true).GetMemberFunctionAtIndex(idx)));
342 return m_opaque_sp->GetCompilerType(
false).GetBasicTypeEnumeration();
352 m_opaque_sp->GetTypeSystem(
false)->GetBasicTypeFromAST(basic_type)));
360 return m_opaque_sp->GetCompilerType(
true).GetNumDirectBaseClasses();
368 return m_opaque_sp->GetCompilerType(
true).GetNumVirtualBaseClasses();
376 return m_opaque_sp->GetCompilerType(
true).GetNumFields();
389 m_opaque_sp->GetDescription(strm, description_level);
404 m_opaque_sp->GetCompilerType(
true).GetDirectBaseClassAtIndex(
408 TypeImplSP(
new TypeImpl(base_class_type)), bit_offset));
421 m_opaque_sp->GetCompilerType(
true).GetVirtualBaseClassAtIndex(
425 TypeImplSP(
new TypeImpl(base_class_type)), bit_offset));
437 if (this_type.IsValid()) {
441 const llvm::APSInt &value) ->
bool {
444 lldb::TypeImplSP(
new TypeImpl(integer_type)), name, value)));
445 sb_enum_member_list.
Append(enum_member);
460 if (this_type.IsValid()) {
461 uint64_t bit_offset = 0;
463 bool is_bitfield =
false;
464 std::string name_sstr;
466 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
467 if (field_type.IsValid()) {
469 if (!name_sstr.empty())
471 sb_type_member.
reset(
473 name, bitfield_bit_size, is_bitfield));
485 return m_opaque_sp->GetCompilerType(
false).IsCompleteType();
493 return m_opaque_sp->GetCompilerType(
true).GetTypeInfo();
509 return m_opaque_sp->GetDisplayTypeName().GetCString();
516 return m_opaque_sp->GetCompilerType(
true).GetTypeClass();
517 return lldb::eTypeClassInvalid;
524 return m_opaque_sp->GetCompilerType(
false).GetNumTemplateArguments();
538 type =
m_opaque_sp->GetCompilerType(
false).GetTypeTemplateArgument(idx);
542 .GetIntegralTemplateArgument(idx)
558 return m_opaque_sp->GetCompilerType(
false).GetTemplateArgumentKind(idx);
570 for (
uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).
GetSize();
577 return this->
operator bool();
579 SBTypeList::operator bool()
const {
582 return (m_opaque_up != NULL);
591 for (
uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).
GetSize();
617 return m_opaque_up->GetSize();
650 return this->
operator bool();
652 SBTypeMember::operator bool()
const {
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();
722 strm.
Printf(
"+%u + %u bits: (", byte_offset, byte_bit_offset);
724 strm.
Printf(
"+%u: (", byte_offset);
726 TypeImplSP type_impl_sp(
m_opaque_up->GetTypeImpl());
728 type_impl_sp->GetDescription(strm, description_level);
730 strm.
Printf(
") %s", name);
733 strm.
Printf(
" : %u", bitfield_bit_size);
779 return this->
operator bool();
781 SBTypeMemberFunction::operator bool()
const {
802 Mangled mangled(mangled_str,
true);
803 return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString();
888 m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
931 GetMemberFunctionAtIndex, (
uint32_t));
958 GetTemplateArgumentKind, (
uint32_t));
lldb_private::TypeMemberImpl & ref()
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
The registry contains a unique mapping between functions and their ID.
Enumerations for broadcasting.
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
lldb_private::TypeImpl & ref()
A stream class that can stream formatted output to a file.
lldb::SBTypeEnumMemberList GetEnumMembers()
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
uint32_t GetNumberOfVirtualBaseClasses()
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
lldb::TypeClass GetTypeClass()
void reset(lldb_private::TypeMemberImpl *)
lldb::SBTypeList GetFunctionArgumentTypes()
lldb::SBType GetPointeeType()
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
void reset(lldb_private::TypeMemberFunctionImpl *)
lldb::TypeMemberFunctionImplSP m_opaque_sp
lldb::SBType & operator=(const lldb::SBType &rhs)
const char * GetMangledName()
void RegisterMethods< SBType >(Registry &R)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
lldb::SBType GetCanonicalType()
const char * GetDemangledName()
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
uint64_t GetOffsetInBytes()
void Append(lldb::SBType type)
lldb::SBType GetReferenceType()
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
lldb::MemberFunctionKind GetKind()
bool operator==(lldb::SBType &rhs)
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
lldb::SBType GetDereferencedType()
lldb::SBType GetFunctionReturnType()
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
bool IsPolymorphicClass()
uint32_t GetNumberOfArguments()
lldb::SBType GetArrayType(uint64_t size)
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
lldb_private::TypeMemberFunctionImpl & ref()
size_t GetNumberOfFunctionArguments() const
lldb::SBType GetPointerType()
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
bool operator!=(lldb::SBType &rhs)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
uint32_t GetBitfieldSizeInBits()
lldb::SBType GetUnqualifiedType()
lldb_private::Stream & ref()
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
lldb::SBType GetTemplateArgumentType(uint32_t idx)
void Append(SBTypeEnumMember entry)
uint64_t GetOffsetInBits()
lldb::BasicType GetBasicType()
const char * GetDisplayTypeName()
lldb::SBType GetArrayElementType()
A uniqued constant string class.
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
uint32_t GetNumberOfFields()
lldb::SBType GetVectorElementType()
uint32_t GetNumberOfTemplateArguments()
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
uint32_t GetNumberOfMemberFunctions()
lldb::SBType GetReturnType()
uint32_t GetNumberOfDirectBaseClasses()
lldb::SBType GetTypedefedType()
lldb::TypeImplSP m_opaque_sp
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
#define LLDB_RECORD_RESULT(Result)
void SetSP(const lldb::TypeImplSP &type_impl_sp)
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
#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)