[Lldb-commits] [lldb] b81a992 - [lldb][TypeSystem] Remove count parameter from TypeSystem::IsFloatingPointType (#165707)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 31 03:18:18 PDT 2025
Author: Michael Buch
Date: 2025-10-31T10:18:13Z
New Revision: b81a9927974b5b2941114b1ca6ceedb61875d988
URL: https://github.com/llvm/llvm-project/commit/b81a9927974b5b2941114b1ca6ceedb61875d988
DIFF: https://github.com/llvm/llvm-project/commit/b81a9927974b5b2941114b1ca6ceedb61875d988.diff
LOG: [lldb][TypeSystem] Remove count parameter from TypeSystem::IsFloatingPointType (#165707)
Similar motivation to https://github.com/llvm/llvm-project/pull/165702.
It was unused in all callsites and inconsistent with other APIs like
`IsIntegerType` (which doesn't take a `count` parameter).
If we ever need a "how many elements does this type represent", we can
implement one with a new TypeSystem API that does exactly that.
Some callsites checked for `count == 1` previously, but I suspect what
they intended to do is check for whether it's a vector type or complex
type, before reading the FP register. I'm somewhat confident that's the
case because the `TypeSystemClang::GetTypeInfo` currently incorrectly
sets the integer and floating point bits for complex and vector types
(will fix separately). But some architectures might choose to pass
single-element vectors in scalar registers. I should probably changes
these to check the vector element size.
All the `count == 2 && is_complex` were redundant because `count == 2`
iff `is_complex == true`. So I just removed the count check there.
Added:
Modified:
lldb/include/lldb/Symbol/CompilerType.h
lldb/include/lldb/Symbol/TypeSystem.h
lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/source/Symbol/CompilerType.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Symbol/CompilerType.h b/lldb/include/lldb/Symbol/CompilerType.h
index 1fcf255123d9f..869c5076ee0a7 100644
--- a/lldb/include/lldb/Symbol/CompilerType.h
+++ b/lldb/include/lldb/Symbol/CompilerType.h
@@ -144,7 +144,7 @@ class CompilerType {
bool IsDefined() const;
- bool IsFloatingPointType(uint32_t &count, bool &is_complex) const;
+ bool IsFloatingPointType(bool &is_complex) const;
bool IsFunctionType() const;
diff --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h
index 40a80d8d09286..25b208a65349b 100644
--- a/lldb/include/lldb/Symbol/TypeSystem.h
+++ b/lldb/include/lldb/Symbol/TypeSystem.h
@@ -163,7 +163,7 @@ class TypeSystem : public PluginInterface,
virtual bool IsDefined(lldb::opaque_compiler_type_t type) = 0;
virtual bool IsFloatingPointType(lldb::opaque_compiler_type_t type,
- uint32_t &count, bool &is_complex) = 0;
+ bool &is_complex) = 0;
virtual bool IsFunctionType(lldb::opaque_compiler_type_t type) = 0;
diff --git a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
index 5b5f6facc924c..8e690218843fa 100644
--- a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
@@ -1695,7 +1695,6 @@ Status ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -1767,7 +1766,7 @@ Status ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
diff --git a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
index bb0c4ba3f1b57..7258f5cc9acb5 100644
--- a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
+++ b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
@@ -1550,7 +1550,6 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
bool is_signed;
bool is_complex;
- uint32_t float_count;
bool is_vfp_candidate = false;
uint8_t vfp_count = 0;
uint8_t vfp_byte_size = 0;
@@ -1634,8 +1633,9 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
if (!GetReturnValuePassedInMemory(thread, reg_ctx, *byte_size, value))
return return_valobj_sp;
}
- } else if (compiler_type.IsFloatingPointType(float_count, is_complex)) {
- if (float_count == 1 && !is_complex) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
+ // Vector types are handled above.
+ if (!is_complex) {
switch (*bit_width) {
default:
return return_valobj_sp;
@@ -1681,7 +1681,7 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
break;
}
}
- } else if (is_complex && float_count == 2) {
+ } else if (is_complex) {
if (IsArmHardFloat(thread)) {
is_vfp_candidate = true;
vfp_byte_size = *byte_size / 2;
@@ -1709,8 +1709,9 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
vfp_count = (*base_byte_size == 8 ? homogeneous_count
: homogeneous_count * 2);
}
- } else if (base_type.IsFloatingPointType(float_count, is_complex)) {
- if (float_count == 1 && !is_complex) {
+ } else if (base_type.IsFloatingPointType(is_complex)) {
+ // Vector types are handled above.
+ if (!is_complex) {
is_vfp_candidate = true;
if (base_byte_size)
vfp_byte_size = *base_byte_size;
@@ -1727,10 +1728,10 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
base_type = compiler_type.GetFieldAtIndex(index, name, nullptr,
nullptr, nullptr);
- if (base_type.IsFloatingPointType(float_count, is_complex)) {
+ if (base_type.IsFloatingPointType(is_complex)) {
std::optional<uint64_t> base_byte_size =
llvm::expectedToOptional(base_type.GetByteSize(&thread));
- if (float_count == 2 && is_complex) {
+ if (is_complex) {
if (index != 0 && base_byte_size &&
vfp_byte_size != *base_byte_size)
break;
@@ -1841,7 +1842,6 @@ Status ABISysV_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -1884,7 +1884,7 @@ Status ABISysV_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
diff --git a/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp b/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
index 7bf99ce7bddee..4f5e29c0eaac7 100644
--- a/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
+++ b/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
@@ -510,11 +510,10 @@ ValueObjectSP ABISysV_loongarch::GetReturnValueObjectSimple(
value, ConstString(""));
}
if (type_flags & eTypeIsFloat) {
- uint32_t float_count = 0;
bool is_complex = false;
- if (compiler_type.IsFloatingPointType(float_count, is_complex) &&
- float_count == 1 && !is_complex) {
+ if (compiler_type.IsFloatingPointType(is_complex) &&
+ !(type_flags & eTypeIsVector) && !is_complex) {
return_valobj_sp =
GetValObjFromFPRegs(thread, reg_ctx, machine, type_flags, byte_size);
return return_valobj_sp;
diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
index dd91a05534e37..e03604467ceec 100644
--- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
+++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
@@ -708,7 +708,6 @@ Status ABISysV_mips::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -750,7 +749,7 @@ Status ABISysV_mips::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
@@ -797,7 +796,6 @@ ValueObjectSP ABISysV_mips::GetReturnValueObjectImpl(
bool is_signed = false;
bool is_complex = false;
- uint32_t count = 0;
// In MIPS register "r2" (v0) holds the integer function return values
const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
@@ -860,10 +858,10 @@ ValueObjectSP ABISysV_mips::GetReturnValueObjectImpl(
return_valobj_sp = ValueObjectMemory::Create(
&thread, "", Address(mem_address, nullptr), return_compiler_type);
return return_valobj_sp;
- } else if (return_compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (return_compiler_type.IsFloatingPointType(is_complex)) {
if (IsSoftFloat(fp_flag)) {
uint64_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r2_reg_info, 0);
- if (count != 1 && is_complex)
+ if (is_complex)
return return_valobj_sp;
switch (*bit_width) {
default:
@@ -896,7 +894,7 @@ ValueObjectSP ABISysV_mips::GetReturnValueObjectImpl(
f0_value.GetData(f0_data);
lldb::offset_t offset = 0;
- if (count == 1 && !is_complex) {
+ if (!return_compiler_type.IsVectorType() && !is_complex) {
switch (*bit_width) {
default:
return return_valobj_sp;
diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
index baefbfc363d99..0dd9db0948220 100644
--- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
+++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
@@ -923,7 +923,6 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
bool sucess = false;
std::string name;
bool is_complex;
- uint32_t count;
const uint32_t num_children = return_compiler_type.GetNumFields();
// A structure consisting of one or two FP values (and nothing else) will
@@ -937,7 +936,7 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
return_compiler_type.GetFieldAtIndex(idx, name, &field_bit_offset,
nullptr, nullptr);
- if (field_compiler_type.IsFloatingPointType(count, is_complex))
+ if (field_compiler_type.IsFloatingPointType(is_complex))
use_fp_regs = true;
else
found_non_fp_field = true;
@@ -1044,7 +1043,7 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
field_compiler_type.IsPointerType() ||
- field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ field_compiler_type.IsFloatingPointType(is_complex)) {
padding = field_byte_offset - integer_bytes;
if (integer_bytes < 8) {
diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
index e4bdc44c59c10..0d25faef1c659 100644
--- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
+++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
@@ -426,7 +426,6 @@ Status ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -454,7 +453,7 @@ Status ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
@@ -695,7 +694,6 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
uint64_t field_bit_offset = 0;
bool is_signed;
bool is_complex;
- uint32_t count;
CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
idx, name, &field_bit_offset, nullptr, nullptr);
@@ -741,7 +739,7 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
// return a nullptr return value object.
return return_valobj_sp;
}
- } else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (field_compiler_type.IsFloatingPointType(is_complex)) {
// Structs with long doubles are always passed in memory.
if (*field_bit_width == 128) {
is_memory = true;
diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
index f5327a1f403c0..63357618774d4 100644
--- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
+++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
@@ -309,7 +309,6 @@ Status ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -339,7 +338,7 @@ Status ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
diff --git a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
index 822c93dbbec3d..53f11b55427aa 100644
--- a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
+++ b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
@@ -643,11 +643,10 @@ ABISysV_riscv::GetReturnValueObjectSimple(Thread &thread,
}
// Floating point return type.
else if (type_flags & eTypeIsFloat) {
- uint32_t float_count = 0;
bool is_complex = false;
- if (compiler_type.IsFloatingPointType(float_count, is_complex) &&
- float_count == 1 && !is_complex) {
+ if (compiler_type.IsFloatingPointType(is_complex) &&
+ !(type_flags & eTypeIsVector) && !is_complex) {
const uint32_t arch_fp_flags =
arch.GetFlags() & ArchSpec::eRISCV_float_abi_mask;
return_valobj_sp = GetValObjFromFPRegs(
diff --git a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
index 5e52b6e4db499..301c3b309ffd5 100644
--- a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
+++ b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
@@ -393,7 +393,6 @@ Status ABISysV_s390x::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -423,7 +422,7 @@ Status ABISysV_s390x::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
diff --git a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
index eaeed6c04590c..ee79abe55ead0 100644
--- a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
@@ -198,7 +198,6 @@ Status ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -240,7 +239,7 @@ Status ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
index effb3de8215d6..29fd9f0eceb93 100644
--- a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
@@ -307,7 +307,6 @@ Status ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -337,7 +336,7 @@ Status ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
@@ -587,7 +586,6 @@ static bool FlattenAggregateType(
for (uint32_t idx = 0; idx < num_children; ++idx) {
std::string name;
bool is_signed;
- uint32_t count;
bool is_complex;
uint64_t field_bit_offset = 0;
@@ -606,7 +604,7 @@ static bool FlattenAggregateType(
const uint32_t field_type_flags = field_compiler_type.GetTypeInfo();
if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
field_compiler_type.IsPointerType() ||
- field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ field_compiler_type.IsFloatingPointType(is_complex)) {
aggregate_field_offsets.push_back(field_byte_offset);
aggregate_compiler_types.push_back(field_compiler_type);
} else if (field_type_flags & eTypeHasChildren) {
@@ -696,7 +694,6 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
is_memory = false;
for (uint32_t idx = 0; idx < num_children; idx++) {
bool is_signed;
- uint32_t count;
bool is_complex;
CompilerType field_compiler_type = aggregate_compiler_types[idx];
@@ -736,7 +733,7 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
// return a nullptr return value object.
return return_valobj_sp;
}
- } else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (field_compiler_type.IsFloatingPointType(is_complex)) {
// Structs with long doubles are always passed in memory.
if (field_bit_width == 128) {
is_memory = true;
diff --git a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
index 339012cffb688..6520af2f643ee 100644
--- a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
@@ -312,7 +312,6 @@ Status ABIWindows_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
Thread *thread = frame_sp->GetThread().get();
bool is_signed;
- uint32_t count;
bool is_complex;
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
@@ -342,7 +341,7 @@ Status ABIWindows_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
"We don't support returning longer than 64 bit "
"integer values at present.");
}
- } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
+ } else if (compiler_type.IsFloatingPointType(is_complex)) {
if (is_complex)
error = Status::FromErrorString(
"We don't support returning complex values at present");
@@ -558,7 +557,6 @@ static bool FlattenAggregateType(
for (uint32_t idx = 0; idx < num_children; ++idx) {
std::string name;
bool is_signed;
- uint32_t count;
bool is_complex;
uint64_t field_bit_offset = 0;
@@ -582,7 +580,7 @@ static bool FlattenAggregateType(
const uint32_t field_type_flags = field_compiler_type.GetTypeInfo();
if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
field_compiler_type.IsPointerType() ||
- field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ field_compiler_type.IsFloatingPointType(is_complex)) {
aggregate_field_offsets.push_back(field_byte_offset);
aggregate_compiler_types.push_back(field_compiler_type);
} else if (field_type_flags & eTypeHasChildren) {
@@ -672,7 +670,6 @@ ValueObjectSP ABIWindows_x86_64::GetReturnValueObjectImpl(
for (uint32_t idx = 0; idx < num_children; idx++) {
bool is_signed;
bool is_complex;
- uint32_t count;
CompilerType field_compiler_type = aggregate_compiler_types[idx];
uint32_t field_byte_width =
@@ -691,7 +688,7 @@ ValueObjectSP ABIWindows_x86_64::GetReturnValueObjectImpl(
uint32_t copy_from_offset = 0;
if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
field_compiler_type.IsPointerType() ||
- field_compiler_type.IsFloatingPointType(count, is_complex)) {
+ field_compiler_type.IsFloatingPointType(is_complex)) {
copy_from_extractor = &rax_data;
copy_from_offset = used_bytes;
used_bytes += field_byte_width;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index c049829f37219..47fa27b0a81a7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2047,11 +2047,10 @@ static std::optional<clang::APValue> MakeAPValue(const clang::ASTContext &ast,
if (is_integral)
return clang::APValue(apint);
- uint32_t count;
bool is_complex;
// FIXME: we currently support a limited set of floating point types.
// E.g., 16-bit floats are not supported.
- if (!clang_type.IsFloatingPointType(count, is_complex))
+ if (!clang_type.IsFloatingPointType(is_complex))
return std::nullopt;
return clang::APValue(llvm::APFloat(
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 4ec987c8d0103..67186542fb705 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -3488,7 +3488,7 @@ bool TypeSystemClang::IsReferenceType(lldb::opaque_compiler_type_t type,
}
bool TypeSystemClang::IsFloatingPointType(lldb::opaque_compiler_type_t type,
- uint32_t &count, bool &is_complex) {
+ bool &is_complex) {
if (type) {
clang::QualType qual_type(GetCanonicalQualType(type));
@@ -3497,30 +3497,26 @@ bool TypeSystemClang::IsFloatingPointType(lldb::opaque_compiler_type_t type,
clang::BuiltinType::Kind kind = BT->getKind();
if (kind >= clang::BuiltinType::Float &&
kind <= clang::BuiltinType::LongDouble) {
- count = 1;
is_complex = false;
return true;
}
} else if (const clang::ComplexType *CT =
llvm::dyn_cast<clang::ComplexType>(
qual_type->getCanonicalTypeInternal())) {
- if (IsFloatingPointType(CT->getElementType().getAsOpaquePtr(), count,
+ if (IsFloatingPointType(CT->getElementType().getAsOpaquePtr(),
is_complex)) {
- count = 2;
is_complex = true;
return true;
}
} else if (const clang::VectorType *VT = llvm::dyn_cast<clang::VectorType>(
qual_type->getCanonicalTypeInternal())) {
- if (IsFloatingPointType(VT->getElementType().getAsOpaquePtr(), count,
+ if (IsFloatingPointType(VT->getElementType().getAsOpaquePtr(),
is_complex)) {
- count = VT->getNumElements();
is_complex = false;
return true;
}
}
}
- count = 0;
is_complex = false;
return false;
}
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 11107c0fea4f6..375891b3cfd2f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -651,7 +651,7 @@ class TypeSystemClang : public TypeSystem {
bool IsDefined(lldb::opaque_compiler_type_t type) override;
- bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count,
+ bool IsFloatingPointType(lldb::opaque_compiler_type_t type,
bool &is_complex) override;
unsigned GetPtrAuthKey(lldb::opaque_compiler_type_t type) override;
diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp
index 73da3127a98a3..c999ab256fc98 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -240,13 +240,11 @@ bool CompilerType::ShouldTreatScalarValueAsAddress() const {
return false;
}
-bool CompilerType::IsFloatingPointType(uint32_t &count,
- bool &is_complex) const {
+bool CompilerType::IsFloatingPointType(bool &is_complex) const {
if (IsValid()) {
if (auto type_system_sp = GetTypeSystem())
- return type_system_sp->IsFloatingPointType(m_type, count, is_complex);
+ return type_system_sp->IsFloatingPointType(m_type, is_complex);
}
- count = 0;
is_complex = false;
return false;
}
@@ -331,9 +329,8 @@ bool CompilerType::IsInteger() const {
}
bool CompilerType::IsFloat() const {
- uint32_t count = 0;
bool is_complex = false;
- return IsFloatingPointType(count, is_complex);
+ return IsFloatingPointType(is_complex);
}
bool CompilerType::IsEnumerationType() const {
More information about the lldb-commits
mailing list