Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/include/lldb/Symbol/CompilerType.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class CompilerType {
bool IsBoundsSafetyBidiIndexable() const;
/* TO_UPSTREAM(BoundsSafety) OFF */

bool IsFloatingPointType(uint32_t &count, bool &is_complex) const;
bool IsFloatingPointType(bool &is_complex) const;

bool IsFunctionType() const;

Expand Down
2 changes: 1 addition & 1 deletion lldb/include/lldb/Symbol/TypeSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,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;

Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
20 changes: 10 additions & 10 deletions lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
9 changes: 3 additions & 6 deletions lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -831,7 +830,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;
Expand All @@ -850,7 +848,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) {
Expand Down Expand Up @@ -975,7 +973,6 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
std::string name;
bool is_signed;
bool already_copied = false;
uint32_t count;
bool is_complex;

CompilerType field_compiler_type = aggregate_compiler_types[idx];
Expand Down Expand Up @@ -1065,7 +1062,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;
Expand Down
9 changes: 3 additions & 6 deletions lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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 =
Expand All @@ -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;
Expand Down
Loading