mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-12 13:55:57 +03:00
Fix some ICEs in debuginfo generator wrt. opaque structs
Just enough to make new compilable/ice20044.d pass with `-g`.
This commit is contained in:
parent
8cff463692
commit
b741ee5715
1 changed files with 7 additions and 3 deletions
|
@ -503,6 +503,10 @@ void DIBuilder::AddFields(AggregateDeclaration *ad, DIFile file,
|
||||||
|
|
||||||
void DIBuilder::AddStaticMembers(AggregateDeclaration *ad, DIFile file,
|
void DIBuilder::AddStaticMembers(AggregateDeclaration *ad, DIFile file,
|
||||||
llvm::SmallVector<LLMetadata *, 16> &elems) {
|
llvm::SmallVector<LLMetadata *, 16> &elems) {
|
||||||
|
auto members = ad->members;
|
||||||
|
if (!members)
|
||||||
|
return;
|
||||||
|
|
||||||
auto scope = CreateCompositeTypeDescription(ad->getType());
|
auto scope = CreateCompositeTypeDescription(ad->getType());
|
||||||
|
|
||||||
std::function<void(Dsymbols *)> visitMembers = [&](Dsymbols *members) {
|
std::function<void(Dsymbols *)> visitMembers = [&](Dsymbols *members) {
|
||||||
|
@ -531,7 +535,7 @@ void DIBuilder::AddStaticMembers(AggregateDeclaration *ad, DIFile file,
|
||||||
// already work without
|
// already work without
|
||||||
// adding them.
|
// adding them.
|
||||||
};
|
};
|
||||||
visitMembers(ad->members);
|
visitMembers(members);
|
||||||
}
|
}
|
||||||
|
|
||||||
DIType DIBuilder::CreateCompositeType(Type *type) {
|
DIType DIBuilder::CreateCompositeType(Type *type) {
|
||||||
|
@ -576,8 +580,8 @@ DIType DIBuilder::CreateCompositeType(Type *type) {
|
||||||
// defaults
|
// defaults
|
||||||
const auto file = CreateFile(ad);
|
const auto file = CreateFile(ad);
|
||||||
const auto lineNum = ad->loc.linnum;
|
const auto lineNum = ad->loc.linnum;
|
||||||
const auto sizeInBits = getTypeAllocSize(T) * 8;
|
const auto sizeInBits = T->isSized() ? getTypeAllocSize(T) * 8 : 0;
|
||||||
const auto alignmentInBits = getABITypeAlign(T) * 8;
|
const auto alignmentInBits = T->isSized() ? getABITypeAlign(T) * 8 : 0;
|
||||||
const auto classOffsetInBits = 0;
|
const auto classOffsetInBits = 0;
|
||||||
auto derivedFrom = getNullDIType();
|
auto derivedFrom = getNullDIType();
|
||||||
const auto vtableHolder = getNullDIType();
|
const auto vtableHolder = getNullDIType();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue