27#include "llvm/ADT/APSInt.h"
28#include "llvm/Support/MathExtras.h"
115 return this->
operator bool();
130 if (std::optional<uint64_t> size = llvm::expectedToOptional(
131 m_opaque_sp->GetCompilerType(
false).GetByteSize(
nullptr)))
142 std::optional<uint64_t> bit_align =
144 .GetTypeBitAlign(
nullptr);
145 return llvm::divideCeil(bit_align.value_or(0), 8);
153 return m_opaque_sp->GetCompilerType(
true).IsPointerType();
161 return m_opaque_sp->GetCompilerType(
true).IsArrayType(
nullptr,
nullptr,
170 return m_opaque_sp->GetCompilerType(
true).IsVectorType(
nullptr,
nullptr);
178 return m_opaque_sp->GetCompilerType(
true).IsReferenceType();
227 return SBType(std::make_shared<TypeImpl>(
228 m_opaque_sp->GetCompilerType(
true).GetArrayElementType(
nullptr)));
236 return SBType(std::make_shared<TypeImpl>(
237 m_opaque_sp->GetCompilerType(
true).GetArrayType(size)));
246 if (
m_opaque_sp->GetCompilerType(
true).IsVectorType(&vector_element_type,
248 type_sb.
SetSP(std::make_shared<TypeImpl>(vector_element_type));
258 return m_opaque_sp->GetCompilerType(
true).IsFunctionType();
266 return m_opaque_sp->GetCompilerType(
true).IsPolymorphicClass();
274 return m_opaque_sp->GetCompilerType(
true).IsTypedefType();
282 return m_opaque_sp->GetCompilerType(
true).IsAnonymousType();
290 return m_opaque_sp->GetCompilerType(
true).IsScopedEnumerationType();
298 return m_opaque_sp->GetCompilerType(
true).IsAggregateType();
306 m_opaque_sp->GetCompilerType(
true).GetFunctionReturnType());
308 return SBType(return_type);
320 for (
size_t i = 0; i < count; i++) {
331 return m_opaque_sp->GetCompilerType(
true).GetNumMemberFunctions();
342 m_opaque_sp->GetCompilerType(
true).GetMemberFunctionAtIndex(idx)));
366SBTypeStaticField::operator
bool()
const {
416 return SBValue(std::move(value_obj_sp));
440 m_opaque_sp->GetCompilerType(
true).GetEnumerationIntegerType());
449 return m_opaque_sp->GetCompilerType(
false).GetBasicTypeEnumeration();
458 return SBType(ts->GetBasicTypeFromAST(basic_type));
466 return m_opaque_sp->GetCompilerType(
true).GetNumDirectBaseClasses();
474 return m_opaque_sp->GetCompilerType(
true).GetNumVirtualBaseClasses();
482 return m_opaque_sp->GetCompilerType(
true).GetNumFields();
493 m_opaque_sp->GetDescription(strm, description_level);
505 uint32_t bit_offset = 0;
507 m_opaque_sp->GetCompilerType(
true).GetDirectBaseClassAtIndex(
511 std::make_shared<TypeImpl>(base_class_type), bit_offset));
513 return sb_type_member;
521 uint32_t bit_offset = 0;
523 m_opaque_sp->GetCompilerType(
true).GetVirtualBaseClassAtIndex(
527 std::make_shared<TypeImpl>(base_class_type), bit_offset));
529 return sb_type_member;
539 .GetStaticFieldWithName(name));
550 [&sb_enum_member_list](
const CompilerType &integer_type,
552 const llvm::APSInt &value) ->
bool {
554 std::make_shared<TypeImpl>(integer_type), name, value));
555 sb_enum_member_list.
Append(enum_member);
560 return sb_enum_member_list;
570 uint64_t bit_offset = 0;
571 uint32_t bitfield_bit_size = 0;
572 bool is_bitfield =
false;
573 std::string name_sstr;
575 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
578 if (!name_sstr.empty())
581 std::make_shared<TypeImpl>(field_type), bit_offset, name,
582 bitfield_bit_size, is_bitfield));
586 return sb_type_member;
607 return m_opaque_sp->GetCompilerType(
true).GetTypeInfo();
634 return m_opaque_sp->GetDisplayTypeName().GetCString();
641 return m_opaque_sp->GetCompilerType(
true).GetTypeClass();
642 return lldb::eTypeClassInvalid;
649 return m_opaque_sp->GetCompilerType(
false).GetNumTemplateArguments(
661 const bool expand_pack =
true;
664 type =
m_opaque_sp->GetCompilerType(
false).GetTypeTemplateArgument(
669 .GetIntegralTemplateArgument(idx, expand_pack)
684 return m_opaque_sp->GetCompilerType(
false).GetTemplateArgumentKind(
696 std::optional<CompilerType::IntegralTemplateArgument> arg;
697 const bool expand_pack =
true;
701 arg =
m_opaque_sp->GetCompilerType(
false).GetIntegralTemplateArgument(
712 arg->value.GetData(data);
715 auto target_sp = target.
GetSP();
719 target_sp->CalculateExecutionContext(exe_ctx);
748 return this->
operator bool();
750SBTypeList::operator
bool()
const {
816 return this->
operator bool();
818SBTypeMember::operator
bool()
const {
881 const uint32_t bit_offset =
m_opaque_up->GetBitOffset();
882 const uint32_t byte_offset = bit_offset / 8u;
883 const uint32_t byte_bit_offset = bit_offset % 8u;
884 const char *name =
m_opaque_up->GetName().GetCString();
886 strm.
Printf(
"+%u + %u bits: (", byte_offset, byte_bit_offset);
888 strm.
Printf(
"+%u: (", byte_offset);
892 type_impl_sp->GetDescription(strm, description_level);
894 strm.
Printf(
") %s", name);
896 const uint32_t bitfield_bit_size =
m_opaque_up->GetBitfieldBitSize();
897 strm.
Printf(
" : %u", bitfield_bit_size);
937 return this->
operator bool();
939SBTypeMemberFunction::operator
bool()
const {
1009 std::make_shared<TypeImpl>(
m_opaque_sp->GetArgumentAtIndex(i)));
1040 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)
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.
const char * GetCString() const
Get the string value as a C string.
"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.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
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