Skip to content

Commit 5a953be

Browse files
committed
[lldb] Use bit size on DWARF encoding
1 parent 662d88c commit 5a953be

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lldb/source/Plugins/TypeSystem/D/TypeSystemD.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,20 @@ TypeSystemD::CreateBaseType(DTypeKind kind) {
675675
CompilerType
676676
TypeSystemD::GetBuiltinTypeForDWARFEncodingAndBitSize(uint32_t dw_ate, uint32_t bit_size)
677677
{
678-
//TODO: Use bit_size
678+
auto IsMatch = [&](DTypeKind kind) {
679+
llvm::Optional<uint64_t> BS = DType::GetBitSize(kind, m_target_triple);
680+
if (BS.hasValue())
681+
return BS.getValue() == bit_size;
682+
683+
return false;
684+
};
679685

680686
switch(dw_ate)
681687
{
682688
case DW_ATE_boolean:
683-
return CreateBaseType(eDTypeKindBool);
689+
if (IsMatch(eDTypeKindBool))
690+
return CreateBaseType(eDTypeKindBool);
691+
break;
684692
default:
685693
break;
686694
}

0 commit comments

Comments
 (0)