28#include "llvm/ADT/APSInt.h"
29#include "llvm/Support/MathExtras.h"
45 : m_opaque_sp(type_impl_sp) {}
116 return this->
operator bool();
131 if (std::optional<uint64_t> size = llvm::expectedToOptional(
132 m_opaque_sp->GetCompilerType(
false).GetByteSize(
nullptr)))
143 std::optional<uint64_t> bit_align =
145 .GetTypeBitAlign(
nullptr);
146 return llvm::divideCeil(bit_align.value_or(0), 8);
165 return m_opaque_sp->GetCompilerType(
true).IsPointerType();
173 return m_opaque_sp->GetCompilerType(
true).IsArrayType(
nullptr,
nullptr,
182 return m_opaque_sp->GetCompilerType(
true).IsVectorType(
nullptr,
nullptr);
190 return m_opaque_sp->GetCompilerType(
true).IsReferenceType();
239 return SBType(std::make_shared<TypeImpl>(
240 m_opaque_sp->GetCompilerType(
true).GetArrayElementType(
nullptr)));
248 return SBType(std::make_shared<TypeImpl>(
249 m_opaque_sp->GetCompilerType(
true).GetArrayType(size)));
258 if (
m_opaque_sp->GetCompilerType(
true).IsVectorType(&vector_element_type,
260 type_sb.
SetSP(std::make_shared<TypeImpl>(vector_element_type));
270 return m_opaque_sp->GetCompilerType(
true).IsFunctionType();
278 return m_opaque_sp->GetCompilerType(
true).IsPolymorphicClass();
286 return m_opaque_sp->GetCompilerType(
true).IsTypedefType();
294 return m_opaque_sp->GetCompilerType(
true).IsAnonymousType();
302 return m_opaque_sp->GetCompilerType(
true).IsScopedEnumerationType();
310 return m_opaque_sp->GetCompilerType(
true).IsAggregateType();
318 m_opaque_sp->GetCompilerType(
true).GetFunctionReturnType());
320 return SBType(return_type);
332 for (
size_t i = 0; i < count; i++) {
343 return m_opaque_sp->GetCompilerType(
true).GetNumMemberFunctions();
354 m_opaque_sp->GetCompilerType(
true).GetMemberFunctionAtIndex(idx)));
378SBTypeStaticField::operator
bool()
const {
428 return SBValue(std::move(value_obj_sp));
452 m_opaque_sp->GetCompilerType(
true).GetEnumerationIntegerType());
461 return m_opaque_sp->GetCompilerType(
false).GetBasicTypeEnumeration();
470 return SBType(ts->GetBasicTypeFromAST(basic_type));
478 return m_opaque_sp->GetCompilerType(
true).GetNumDirectBaseClasses();
486 return m_opaque_sp->GetCompilerType(
true).GetNumVirtualBaseClasses();
494 return m_opaque_sp->GetCompilerType(
true).GetNumFields();
505 m_opaque_sp->GetDescription(strm, description_level);
517 uint32_t bit_offset = 0;
519 m_opaque_sp->GetCompilerType(
true).GetDirectBaseClassAtIndex(
523 std::make_shared<TypeImpl>(base_class_type), bit_offset));
525 return sb_type_member;
533 uint32_t bit_offset = 0;
535 m_opaque_sp->GetCompilerType(
true).GetVirtualBaseClassAtIndex(
539 std::make_shared<TypeImpl>(base_class_type), bit_offset));
541 return sb_type_member;
551 .GetStaticFieldWithName(name));
562 [&sb_enum_member_list](
const CompilerType &integer_type,
564 const llvm::APSInt &value) ->
bool {
566 std::make_shared<TypeImpl>(integer_type), name, value));
567 sb_enum_member_list.
Append(enum_member);
572 return sb_enum_member_list;
582 uint64_t bit_offset = 0;
583 uint32_t bitfield_bit_size = 0;
584 bool is_bitfield =
false;
585 std::string name_sstr;
587 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
590 if (!name_sstr.empty())
593 std::make_shared<TypeImpl>(field_type), bit_offset, name,
594 bitfield_bit_size, is_bitfield));
598 return sb_type_member;
619 return m_opaque_sp->GetCompilerType(
true).GetTypeInfo();
653 return m_opaque_sp->GetCompilerType(
true).GetTypeClass();
654 return lldb::eTypeClassInvalid;
661 return m_opaque_sp->GetCompilerType(
false).GetNumTemplateArguments(
673 const bool expand_pack =
true;
676 type =
m_opaque_sp->GetCompilerType(
false).GetTypeTemplateArgument(
681 .GetIntegralTemplateArgument(idx, expand_pack)
696 return m_opaque_sp->GetCompilerType(
false).GetTemplateArgumentKind(
708 std::optional<CompilerType::IntegralTemplateArgument> arg;
709 const bool expand_pack =
true;
713 arg =
m_opaque_sp->GetCompilerType(
false).GetIntegralTemplateArgument(
724 arg->value.GetData(data);
727 auto target_sp = target.
GetSP();
731 target_sp->CalculateExecutionContext(exe_ctx);
760 return this->
operator bool();
762SBTypeList::operator
bool()
const {
828 return this->
operator bool();
830SBTypeMember::operator
bool()
const {
893 const uint32_t bit_offset =
m_opaque_up->GetBitOffset();
894 const uint32_t byte_offset = bit_offset / 8u;
895 const uint32_t byte_bit_offset = bit_offset % 8u;
896 const char *name =
m_opaque_up->GetName().GetCString();
898 strm.
Printf(
"+%u + %u bits: (", byte_offset, byte_bit_offset);
900 strm.
Printf(
"+%u: (", byte_offset);
904 type_impl_sp->GetDescription(strm, description_level);
906 strm.
Printf(
") %s", name);
908 const uint32_t bitfield_bit_size =
m_opaque_up->GetBitfieldBitSize();
909 strm.
Printf(
" : %u", bitfield_bit_size);
949 return this->
operator bool();
951SBTypeMemberFunction::operator
bool()
const {
1021 std::make_shared<TypeImpl>(
m_opaque_sp->GetArgumentAtIndex(i)));
1052 m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
#define LLDB_INSTRUMENT_VA(...)
void SetSP(const ModuleSP &module_sp)
lldb_private::Stream & ref()
lldb::TargetSP GetSP() const
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()
lldb::SBTypeStaticField & operator=(const lldb::SBTypeStaticField &rhs)
const char * GetMangledName()
lldb::SBValue GetConstantValue(lldb::SBTarget target)
std::unique_ptr< lldb_private::CompilerDecl > m_opaque_up
uint32_t GetNumberOfTemplateArguments()
uint32_t GetNumberOfDirectBaseClasses()
lldb::SBType FindDirectNestedType(const char *name)
lldb::SBType GetReferenceType()
lldb::SBType GetArrayType(uint64_t size)
lldb::SBType GetVectorElementType()
lldb::SBValue GetTemplateArgumentValue(lldb::SBTarget target, uint32_t idx)
Returns the value of the non-type template parameter at index idx.
uint32_t GetNumberOfFields()
lldb::SBType GetDereferencedType()
friend class SBTypeEnumMember
lldb::SBModule GetModule()
lldb::BasicType GetBasicType()
bool IsPolymorphicClass()
friend class SBTypeEnumMemberList
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()
friend class SBTypeStaticField
bool operator!=(lldb::SBType &rhs)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::SBTypeList GetFunctionArgumentTypes()
friend class SBTypeMemberFunction
uint32_t GetNumberOfVirtualBaseClasses()
lldb::SBType GetTypedefedType()
lldb_private::TypeImpl & ref()
lldb::SBTypeStaticField GetStaticFieldWithName(const char *name)
uint64_t GetByteStride()
Return the distance in bytes between consecutive elements of this type when stored in contiguous stor...
lldb::SBType & operator=(const lldb::SBType &rhs)
lldb::SBType GetFunctionReturnType()
lldb::TypeImplSP m_opaque_sp
lldb::SBType GetUnqualifiedType()
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
friend class SBTypeMember
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()
Represents a generic declaration such as a function declaration.
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.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A class that handles mangled names.
ConstString GetDemangledName() const
Demangled name get accessor.
bool GetData(DataExtractor &data) const
Get data with a byte size of GetByteSize().
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.
const char * Intern(llvm::StringRef str) const
static StringPoolRef GetSystemPool()
The system pool. Only valid between Initialize and Terminate.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS, ValueObjectManager *manager=nullptr)
These routines create ValueObjectConstResult ValueObjects from various data sources.
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type, ValueObject *parent=nullptr)
A class that represents a running process on the host machine.
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
std::shared_ptr< lldb_private::Type > TypeSP
@ eTemplateArgumentKindNull
@ eTemplateArgumentKindIntegral
@ eTemplateArgumentKindType
@ eTemplateArgumentKindStructuralValue
MemberFunctionKind
Kind of member function.
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP