mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
Change the return type of ValueObject::CalculateNumChildren to uint32_t.
In the end this value comes from TypeSystem::GetNumChildren which returns a uint32_t, so ValueObject should be consistent with that.
This commit is contained in:
@@ -958,7 +958,7 @@ protected:
|
||||
int32_t synthetic_index);
|
||||
|
||||
/// Should only be called by ValueObject::GetNumChildren().
|
||||
virtual size_t CalculateNumChildren(uint32_t max = UINT32_MAX) = 0;
|
||||
virtual uint32_t CalculateNumChildren(uint32_t max = UINT32_MAX) = 0;
|
||||
|
||||
void SetNumChildren(size_t num_children);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
|
||||
std::optional<uint64_t> GetByteSize() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
ConstString GetTypeName() override;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
ConstString GetTypeName() override;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
ConstString GetDisplayTypeName() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
ConstString GetDisplayTypeName() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
ConstString GetQualifiedTypeName() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
|
||||
int32_t synthetic_index) override;
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
ConstString GetTypeName() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
bool SetValueFromCString(const char *value_str, Status &error) override;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
bool MightHaveChildren() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
std::optional<uint64_t> GetByteSize() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
|
||||
int32_t synthetic_index) override;
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
ConstString GetDisplayTypeName() override;
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override;
|
||||
uint32_t CalculateNumChildren(uint32_t max) override;
|
||||
|
||||
lldb::ValueType GetValueType() const override;
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ class ValueObjectRecognizerSynthesizedValue : public ValueObject {
|
||||
m_value = m_parent->GetValue();
|
||||
return true;
|
||||
}
|
||||
size_t CalculateNumChildren(uint32_t max = UINT32_MAX) override {
|
||||
uint32_t CalculateNumChildren(uint32_t max = UINT32_MAX) override {
|
||||
return m_parent->GetNumChildren(max);
|
||||
}
|
||||
CompilerType GetCompilerTypeImpl() override {
|
||||
|
||||
@@ -41,7 +41,7 @@ ValueObjectCast::~ValueObjectCast() = default;
|
||||
|
||||
CompilerType ValueObjectCast::GetCompilerTypeImpl() { return m_cast_type; }
|
||||
|
||||
size_t ValueObjectCast::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectCast::CalculateNumChildren(uint32_t max) {
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
auto children_count = GetCompilerType().GetNumChildren(
|
||||
true, &exe_ctx);
|
||||
|
||||
@@ -49,7 +49,7 @@ lldb::ValueType ValueObjectChild::GetValueType() const {
|
||||
return m_parent->GetValueType();
|
||||
}
|
||||
|
||||
size_t ValueObjectChild::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectChild::CalculateNumChildren(uint32_t max) {
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx);
|
||||
return children_count <= max ? children_count : max;
|
||||
|
||||
@@ -216,7 +216,7 @@ std::optional<uint64_t> ValueObjectConstResult::GetByteSize() {
|
||||
|
||||
void ValueObjectConstResult::SetByteSize(size_t size) { m_byte_size = size; }
|
||||
|
||||
size_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) {
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx);
|
||||
return children_count <= max ? children_count : max;
|
||||
|
||||
@@ -85,7 +85,7 @@ ConstString ValueObjectDynamicValue::GetDisplayTypeName() {
|
||||
return m_parent->GetDisplayTypeName();
|
||||
}
|
||||
|
||||
size_t ValueObjectDynamicValue::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectDynamicValue::CalculateNumChildren(uint32_t max) {
|
||||
const bool success = UpdateValueIfNeeded(false);
|
||||
if (success && m_dynamic_type_info.HasType()) {
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
|
||||
@@ -126,7 +126,7 @@ ConstString ValueObjectMemory::GetDisplayTypeName() {
|
||||
return m_compiler_type.GetDisplayTypeName();
|
||||
}
|
||||
|
||||
size_t ValueObjectMemory::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectMemory::CalculateNumChildren(uint32_t max) {
|
||||
if (m_type_sp) {
|
||||
auto child_count = m_type_sp->GetNumChildren(true);
|
||||
return child_count <= max ? child_count : max;
|
||||
|
||||
@@ -74,7 +74,7 @@ ConstString ValueObjectRegisterSet::GetQualifiedTypeName() {
|
||||
return ConstString();
|
||||
}
|
||||
|
||||
size_t ValueObjectRegisterSet::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectRegisterSet::CalculateNumChildren(uint32_t max) {
|
||||
const RegisterSet *reg_set = m_reg_ctx_sp->GetRegisterSet(m_reg_set_idx);
|
||||
if (reg_set) {
|
||||
auto reg_count = reg_set->num_registers;
|
||||
@@ -220,7 +220,7 @@ ConstString ValueObjectRegister::GetTypeName() {
|
||||
return m_type_name;
|
||||
}
|
||||
|
||||
size_t ValueObjectRegister::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectRegister::CalculateNumChildren(uint32_t max) {
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx);
|
||||
return children_count <= max ? children_count : max;
|
||||
|
||||
@@ -84,7 +84,7 @@ ConstString ValueObjectSynthetic::GetDisplayTypeName() {
|
||||
return m_parent->GetDisplayTypeName();
|
||||
}
|
||||
|
||||
size_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
UpdateValueIfNeeded();
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
|
||||
std::optional<uint64_t> GetByteSize() override { return m_addr_size; };
|
||||
|
||||
size_t CalculateNumChildren(uint32_t max) override { return 0; };
|
||||
uint32_t CalculateNumChildren(uint32_t max) override { return 0; };
|
||||
|
||||
ValueType GetValueType() const override { return eValueTypeVTableEntry; };
|
||||
|
||||
@@ -159,7 +159,7 @@ std::optional<uint64_t> ValueObjectVTable::GetByteSize() {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
size_t ValueObjectVTable::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectVTable::CalculateNumChildren(uint32_t max) {
|
||||
if (UpdateValueIfNeeded(false))
|
||||
return m_num_vtable_entries <= max ? m_num_vtable_entries : max;
|
||||
return 0;
|
||||
|
||||
@@ -94,7 +94,7 @@ ConstString ValueObjectVariable::GetQualifiedTypeName() {
|
||||
return ConstString();
|
||||
}
|
||||
|
||||
size_t ValueObjectVariable::CalculateNumChildren(uint32_t max) {
|
||||
uint32_t ValueObjectVariable::CalculateNumChildren(uint32_t max) {
|
||||
CompilerType type(GetCompilerType());
|
||||
|
||||
if (!type.IsValid())
|
||||
|
||||
Reference in New Issue
Block a user