aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp5
-rw-r--r--lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp3
-rw-r--r--lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp20
-rw-r--r--lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp5
-rw-r--r--lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp10
-rw-r--r--lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp5
-rw-r--r--lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp6
-rw-r--r--lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp3
-rw-r--r--lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp5
-rw-r--r--lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp3
-rw-r--r--lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp3
-rw-r--r--lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp9
-rw-r--r--lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp9
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp30
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h5
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp6
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp31
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h1
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp7
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h8
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp67
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp18
-rw-r--r--lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp57
-rw-r--r--lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h5
25 files changed, 193 insertions, 130 deletions
diff --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
index f9c249d..e41a28b 100644
--- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
+++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
@@ -480,11 +480,10 @@ ABISysV_arc::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) &&
- 1 == float_count && !is_complex) {
+ if (compiler_type.IsFloatingPointType(is_complex) &&
+ !compiler_type.IsVectorType() && !is_complex) {
const size_t byte_size =
llvm::expectedToOptional(compiler_type.GetByteSize(&thread))
.value_or(0);
diff --git a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
index 5b5f6fa..8e69021 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 bb0c4ba..7258f5c 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 7bf99ce..4f5e29c 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 dd91a05..e036044 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 baefbfc..0dd9db0 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 e4bdc44..0d25fae 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 f5327a1..6335761 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 822c93d..53f11b5 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 5e52b6e..301c3b3 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 eaeed6c..ee79abe 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 effb3de..29fd9f0 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 339012c..6520af2 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/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 9cdb846..c8e520d 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1674,6 +1674,10 @@ void ObjectFileMachO::ProcessSegmentCommand(
uint32_t segment_sect_idx;
const lldb::user_id_t first_segment_sectID = context.NextSectionIdx + 1;
+ // 64 bit mach-o files have sections with 32 bit file offsets. If any section
+ // data end will exceed UINT32_MAX, then we need to do some bookkeeping to
+ // ensure we can access this data correctly.
+ uint64_t section_offset_adjust = 0;
const uint32_t num_u32s = load_cmd.cmd == LC_SEGMENT ? 7 : 8;
for (segment_sect_idx = 0; segment_sect_idx < load_cmd.nsects;
++segment_sect_idx) {
@@ -1697,6 +1701,16 @@ void ObjectFileMachO::ProcessSegmentCommand(
// isn't stored in the abstracted Sections.
m_mach_sections.push_back(sect64);
+ // Make sure we can load sections in mach-o files where some sections cross
+ // a 4GB boundary. llvm::MachO::section_64 have only 32 bit file offsets
+ // for the file offset of the section contents, so we need to track and
+ // sections that overflow and adjust the offsets accordingly.
+ const uint64_t section_file_offset =
+ (uint64_t)sect64.offset + section_offset_adjust;
+ const uint64_t end_section_offset = (uint64_t)sect64.offset + sect64.size;
+ if (end_section_offset >= UINT32_MAX)
+ section_offset_adjust += end_section_offset & 0xFFFFFFFF00000000ull;
+
if (add_section) {
ConstString section_name(
sect64.sectname, strnlen(sect64.sectname, sizeof(sect64.sectname)));
@@ -1736,13 +1750,13 @@ void ObjectFileMachO::ProcessSegmentCommand(
}
// Grow the section size as needed.
- if (sect64.offset) {
+ if (section_file_offset) {
const lldb::addr_t segment_min_file_offset =
segment->GetFileOffset();
const lldb::addr_t segment_max_file_offset =
segment_min_file_offset + segment->GetFileSize();
- const lldb::addr_t section_min_file_offset = sect64.offset;
+ const lldb::addr_t section_min_file_offset = section_file_offset;
const lldb::addr_t section_max_file_offset =
section_min_file_offset + sect64.size;
const lldb::addr_t new_file_offset =
@@ -1769,10 +1783,10 @@ void ObjectFileMachO::ProcessSegmentCommand(
// other sections.
sect64.addr, // File VM address == addresses as they are
// found in the object file
- sect64.size, // VM size in bytes of this section
- sect64.offset, // Offset to the data for this section in
+ sect64.size, // VM size in bytes of this section
+ section_file_offset, // Offset to the data for this section in
// the file
- sect64.offset ? sect64.size : 0, // Size in bytes of
+ section_file_offset ? sect64.size : 0, // Size in bytes of
// this section as
// found in the file
sect64.align,
@@ -1792,14 +1806,14 @@ void ObjectFileMachO::ProcessSegmentCommand(
SectionSP section_sp(new Section(
segment_sp, module_sp, this, ++context.NextSectionIdx, section_name,
sect_type, sect64.addr - segment_sp->GetFileAddress(), sect64.size,
- sect64.offset, sect64.offset == 0 ? 0 : sect64.size, sect64.align,
- sect64.flags));
+ section_file_offset, section_file_offset == 0 ? 0 : sect64.size,
+ sect64.align, sect64.flags));
// Set the section to be encrypted to match the segment
bool section_is_encrypted = false;
if (!segment_is_encrypted && load_cmd.filesize != 0)
section_is_encrypted = context.EncryptedRanges.FindEntryThatContains(
- sect64.offset) != nullptr;
+ section_file_offset) != nullptr;
section_sp->SetIsEncrypted(segment_is_encrypted || section_is_encrypted);
section_sp->SetPermissions(segment_permissions);
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
index 7b39d29..27f5d2e 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
@@ -158,8 +158,9 @@ public:
static PyObject *LLDBSwigPython_GetChildAtIndex(PyObject *implementor,
uint32_t idx);
- static int LLDBSwigPython_GetIndexOfChildWithName(PyObject *implementor,
- const char *child_name);
+ static uint32_t
+ LLDBSwigPython_GetIndexOfChildWithName(PyObject *implementor,
+ const char *child_name);
static lldb::ValueObjectSP
LLDBSWIGPython_GetValueObjectSPFromSBValue(void *data);
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 73c5c72..d257a08 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1939,7 +1939,7 @@ lldb::ValueObjectSP ScriptInterpreterPythonImpl::GetChildAtIndex(
return ret_val;
}
-llvm::Expected<int> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
+llvm::Expected<uint32_t> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
const StructuredData::ObjectSP &implementor_sp, const char *child_name) {
if (!implementor_sp)
return llvm::createStringError("Type has no child named '%s'", child_name);
@@ -1951,7 +1951,7 @@ llvm::Expected<int> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
if (!implementor)
return llvm::createStringError("Type has no child named '%s'", child_name);
- int ret_val = INT32_MAX;
+ uint32_t ret_val = UINT32_MAX;
{
Locker py_lock(this,
@@ -1960,7 +1960,7 @@ llvm::Expected<int> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
child_name);
}
- if (ret_val == INT32_MAX)
+ if (ret_val == UINT32_MAX)
return llvm::createStringError("Type has no child named '%s'", child_name);
return ret_val;
}
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
index dedac28..00ae59c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
@@ -122,7 +122,7 @@ public:
GetChildAtIndex(const StructuredData::ObjectSP &implementor,
uint32_t idx) override;
- llvm::Expected<int>
+ llvm::Expected<uint32_t>
GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor,
const char *child_name) override;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 82e9d86..63b2dc4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -450,6 +450,10 @@ ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(const DWARFDIE &die) {
byte_size = form_value.Unsigned();
break;
+ case DW_AT_bit_size:
+ data_bit_size = form_value.Unsigned();
+ break;
+
case DW_AT_alignment:
alignment = form_value.Unsigned();
break;
@@ -810,13 +814,18 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
// there...
[[fallthrough]];
- case DW_TAG_base_type:
+ case DW_TAG_base_type: {
resolve_state = Type::ResolveState::Full;
+ // If a builtin type's size isn't a multiple of a byte, DWARF producers may
+ // add a precise bit-size to the type. Use the most precise bit-size
+ // possible.
+ const uint64_t bit_size = attrs.data_bit_size
+ ? *attrs.data_bit_size
+ : attrs.byte_size.value_or(0) * 8;
clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize(
- attrs.name.GetStringRef(), attrs.encoding,
- attrs.byte_size.value_or(0) * 8);
+ attrs.name.GetStringRef(), attrs.encoding, bit_size);
break;
-
+ }
case DW_TAG_pointer_type:
encoding_data_type = Type::eEncodingIsPointerUID;
break;
@@ -1901,6 +1910,17 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
m_ast.CreateClassTemplateSpecializationDecl(
containing_decl_ctx, GetOwningClangModule(die), class_template_decl,
tag_decl_kind, template_param_infos);
+ if (!class_specialization_decl) {
+ if (log) {
+ dwarf->GetObjectFile()->GetModule()->LogMessage(
+ log,
+ "SymbolFileDWARF({0:p}) - Failed to create specialization for "
+ "clang::ClassTemplateDecl({1}, {2:p}).",
+ this, llvm::StringRef(attrs.name), class_template_decl);
+ }
+ return TypeSP();
+ }
+
clang_type =
m_ast.CreateClassTemplateSpecializationType(class_specialization_decl);
@@ -2032,11 +2052,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/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
index da58f4c..f5f7071 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
@@ -574,6 +574,7 @@ struct ParsedDWARFTypeAttributes {
lldb_private::plugin::dwarf::DWARFFormValue type;
lldb::LanguageType class_language = lldb::eLanguageTypeUnknown;
std::optional<uint64_t> byte_size;
+ std::optional<uint64_t> data_bit_size;
std::optional<uint64_t> alignment;
size_t calling_convention = llvm::dwarf::DW_CC_normal;
uint32_t bit_stride = 0;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
index d90108f..36dee14 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -22,7 +22,6 @@
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h"
#include "lldb/lldb-private-enumerations.h"
-#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ThreadPool.h"
#include <atomic>
#include <optional>
@@ -33,10 +32,10 @@ using namespace lldb_private::plugin::dwarf;
using namespace llvm::dwarf;
void ManualDWARFIndex::Index() {
- if (m_indexed)
- return;
- m_indexed = true;
+ std::call_once(m_indexed_flag, [this]() { IndexImpl(); });
+}
+void ManualDWARFIndex::IndexImpl() {
ElapsedTime elapsed(m_index_time);
LLDB_SCOPED_TIMERF("%p", static_cast<void *>(m_dwarf));
if (LoadFromCache()) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
index 0b5b2f3..41e0e62 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
@@ -66,8 +66,14 @@ public:
void Dump(Stream &s) override;
private:
+ /// Reads the DWARF debug info to build the index once.
+ ///
+ /// Should be called before attempting to retrieve symbols.
void Index();
+ /// Call `ManualDWARFIndex::Index()` instead.
+ void IndexImpl();
+
/// Decode a serialized version of this object from data.
///
/// \param data
@@ -170,7 +176,7 @@ private:
llvm::DenseSet<uint64_t> m_type_sigs_to_avoid;
IndexSet<NameToDIE> m_set;
- bool m_indexed = false;
+ std::once_flag m_indexed_flag;
};
} // namespace dwarf
} // namespace lldb_private::plugin
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index e76b7a3..aaec160 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -1130,7 +1130,35 @@ void SymbolFileNativePDB::AddSymbols(Symtab &symtab) {
if (!section_list)
return;
- for (auto pid : m_index->publics().getPublicsTable()) {
+ PublicSym32 last_sym;
+ size_t last_sym_idx = 0;
+ lldb::SectionSP section_sp;
+
+ // To estimate the size of a symbol, we use the difference to the next symbol.
+ // If there's no next symbol or the section/segment changed, the symbol will
+ // take the remaining space. The estimate can be too high in case there's
+ // padding between symbols. This similar to the algorithm used by the DIA
+ // SDK.
+ auto finish_last_symbol = [&](const PublicSym32 *next) {
+ if (!section_sp)
+ return;
+ Symbol *last = symtab.SymbolAtIndex(last_sym_idx);
+ if (!last)
+ return;
+
+ if (next && last_sym.Segment == next->Segment) {
+ assert(last_sym.Offset <= next->Offset);
+ last->SetByteSize(next->Offset - last_sym.Offset);
+ } else {
+ // the last symbol was the last in its section
+ assert(section_sp->GetByteSize() >= last_sym.Offset);
+ assert(!next || next->Segment > last_sym.Segment);
+ last->SetByteSize(section_sp->GetByteSize() - last_sym.Offset);
+ }
+ };
+
+ // The address map is sorted by the address of a symbol.
+ for (auto pid : m_index->publics().getAddressMap()) {
PdbGlobalSymId global{pid, true};
CVSymbol sym = m_index->ReadSymbolRecord(global);
auto kind = sym.kind();
@@ -1138,8 +1166,11 @@ void SymbolFileNativePDB::AddSymbols(Symtab &symtab) {
continue;
PublicSym32 pub =
llvm::cantFail(SymbolDeserializer::deserializeAs<PublicSym32>(sym));
+ finish_last_symbol(&pub);
+
+ if (!section_sp || last_sym.Segment != pub.Segment)
+ section_sp = section_list->FindSectionByID(pub.Segment);
- auto section_sp = section_list->FindSectionByID(pub.Segment);
if (!section_sp)
continue;
@@ -1148,20 +1179,24 @@ void SymbolFileNativePDB::AddSymbols(Symtab &symtab) {
(pub.Flags & PublicSymFlags::Code) != PublicSymFlags::None)
type = eSymbolTypeCode;
- symtab.AddSymbol(Symbol(/*symID=*/pid,
- /*name=*/pub.Name,
- /*type=*/type,
- /*external=*/true,
- /*is_debug=*/true,
- /*is_trampoline=*/false,
- /*is_artificial=*/false,
- /*section_sp=*/section_sp,
- /*value=*/pub.Offset,
- /*size=*/0,
- /*size_is_valid=*/false,
- /*contains_linker_annotations=*/false,
- /*flags=*/0));
- }
+ last_sym_idx =
+ symtab.AddSymbol(Symbol(/*symID=*/pid,
+ /*name=*/pub.Name,
+ /*type=*/type,
+ /*external=*/true,
+ /*is_debug=*/true,
+ /*is_trampoline=*/false,
+ /*is_artificial=*/false,
+ /*section_sp=*/section_sp,
+ /*value=*/pub.Offset,
+ /*size=*/0,
+ /*size_is_valid=*/false,
+ /*contains_linker_annotations=*/false,
+ /*flags=*/0));
+ last_sym = pub;
+ }
+
+ finish_last_symbol(nullptr);
}
size_t SymbolFileNativePDB::ParseFunctions(CompileUnit &comp_unit) {
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index 3b936c0..0ccb1804 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -83,8 +83,8 @@ constexpr OptionEnumValueElement g_pdb_reader_enums[] = {
{
ePDBReaderDefault,
"default",
- "Use DIA PDB reader unless LLDB_USE_NATIVE_PDB_READER environment "
- "variable is set",
+ "Use native PDB reader unless LLDB_USE_NATIVE_PDB_READER environment "
+ "is set to 0",
},
{
ePDBReaderDIA,
@@ -109,16 +109,10 @@ enum {
static const bool g_should_use_native_reader_by_default = [] {
llvm::StringRef env_value = ::getenv("LLDB_USE_NATIVE_PDB_READER");
-#if !LLVM_ENABLE_DIA_SDK || !defined(_WIN32)
- // if the environment value is unset, the native reader is requested
- if (env_value.empty())
- return true;
-#endif
-
- return env_value.equals_insensitive("on") ||
- env_value.equals_insensitive("yes") ||
- env_value.equals_insensitive("1") ||
- env_value.equals_insensitive("true");
+ return !env_value.equals_insensitive("off") &&
+ !env_value.equals_insensitive("no") &&
+ !env_value.equals_insensitive("0") &&
+ !env_value.equals_insensitive("false");
}();
class PluginProperties : public Properties {
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 82dfe7e..51cb883 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1000,6 +1000,8 @@ CompilerType TypeSystemClang::GetBuiltinTypeForDWARFEncodingAndBitSize(
case DW_ATE_signed:
if (!type_name.empty()) {
+ if (type_name.starts_with("_BitInt"))
+ return GetType(ast.getBitIntType(/*Unsigned=*/false, bit_size));
if (type_name == "wchar_t" &&
QualTypeMatchesBitSize(bit_size, ast, ast.WCharTy) &&
(getTargetInfo() &&
@@ -1056,6 +1058,8 @@ CompilerType TypeSystemClang::GetBuiltinTypeForDWARFEncodingAndBitSize(
case DW_ATE_unsigned:
if (!type_name.empty()) {
+ if (type_name.starts_with("unsigned _BitInt"))
+ return GetType(ast.getBitIntType(/*Unsigned=*/true, bit_size));
if (type_name == "wchar_t") {
if (QualTypeMatchesBitSize(bit_size, ast, ast.WCharTy)) {
if (!(getTargetInfo() &&
@@ -1693,6 +1697,11 @@ TypeSystemClang::CreateClassTemplateSpecializationDecl(
class_template_specialization_decl->setInstantiationOf(class_template_decl);
class_template_specialization_decl->setTemplateArgs(
TemplateArgumentList::CreateCopy(ast, args));
+ void *insert_pos = nullptr;
+ if (class_template_decl->findSpecialization(args, insert_pos))
+ return nullptr;
+ class_template_decl->AddSpecialization(class_template_specialization_decl,
+ insert_pos);
class_template_specialization_decl->setDeclName(
class_template_decl->getDeclName());
@@ -3483,7 +3492,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));
@@ -3492,30 +3501,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;
}
@@ -3888,6 +3893,13 @@ TypeSystemClang::GetTypeInfo(lldb::opaque_compiler_type_t type,
->getModifiedType()
.getAsOpaquePtr(),
pointee_or_element_clang_type);
+ case clang::Type::BitInt: {
+ uint32_t type_flags = eTypeIsScalar | eTypeIsInteger | eTypeHasValue;
+ if (qual_type->isSignedIntegerType())
+ type_flags |= eTypeIsSigned;
+
+ return type_flags;
+ }
case clang::Type::Builtin: {
const clang::BuiltinType *builtin_type =
llvm::cast<clang::BuiltinType>(qual_type->getCanonicalTypeInternal());
@@ -3960,9 +3972,9 @@ TypeSystemClang::GetTypeInfo(lldb::opaque_compiler_type_t type,
if (complex_type) {
clang::QualType complex_element_type(complex_type->getElementType());
if (complex_element_type->isIntegerType())
- complex_type_flags |= eTypeIsFloat;
- else if (complex_element_type->isFloatingType())
complex_type_flags |= eTypeIsInteger;
+ else if (complex_element_type->isFloatingType())
+ complex_type_flags |= eTypeIsFloat;
}
return complex_type_flags;
} break;
@@ -4057,12 +4069,17 @@ TypeSystemClang::GetTypeInfo(lldb::opaque_compiler_type_t type,
uint32_t vector_type_flags = eTypeHasChildren | eTypeIsVector;
const clang::VectorType *vector_type = llvm::dyn_cast<clang::VectorType>(
qual_type->getCanonicalTypeInternal());
- if (vector_type) {
- if (vector_type->isIntegerType())
- vector_type_flags |= eTypeIsFloat;
- else if (vector_type->isFloatingType())
- vector_type_flags |= eTypeIsInteger;
- }
+ if (!vector_type)
+ return 0;
+
+ QualType element_type = vector_type->getElementType();
+ if (element_type.isNull())
+ return 0;
+
+ if (element_type->isIntegerType())
+ vector_type_flags |= eTypeIsInteger;
+ else if (element_type->isFloatingType())
+ vector_type_flags |= eTypeIsFloat;
return vector_type_flags;
}
default:
@@ -4859,12 +4876,10 @@ TypeSystemClang::GetTypeBitAlign(lldb::opaque_compiler_type_t type,
return {};
}
-lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
- uint64_t &count) {
+lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type) {
if (!type)
return lldb::eEncodingInvalid;
- count = 1;
clang::QualType qual_type = RemoveWrappingTypes(GetCanonicalQualType(type));
switch (qual_type->getTypeClass()) {
@@ -4898,7 +4913,6 @@ lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::DependentVector:
case clang::Type::ExtVector:
case clang::Type::Vector:
- // TODO: Set this to more than one???
break;
case clang::Type::BitInt:
@@ -5099,11 +5113,10 @@ lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
const clang::ComplexType *complex_type =
qual_type->getAsComplexIntegerType();
if (complex_type)
- encoding = GetType(complex_type->getElementType()).GetEncoding(count);
+ encoding = GetType(complex_type->getElementType()).GetEncoding();
else
encoding = lldb::eEncodingSint;
}
- count = 2;
return encoding;
}
@@ -5160,7 +5173,7 @@ lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::SubstBuiltinTemplatePack:
break;
}
- count = 0;
+
return lldb::eEncodingInvalid;
}
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 9e0a542..375891b 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -651,7 +651,7 @@ public:
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;
@@ -837,8 +837,7 @@ public:
GetBitSize(lldb::opaque_compiler_type_t type,
ExecutionContextScope *exe_scope) override;
- lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type,
- uint64_t &count) override;
+ lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type) override;
lldb::Format GetFormat(lldb::opaque_compiler_type_t type) override;