mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Merge pull request #3868 from kinke/di_ptr
DI: Don't emit explicit alignment for pointer types
This commit is contained in:
parent
222f4df356
commit
4e061791b4
1 changed files with 6 additions and 12 deletions
|
@ -370,8 +370,6 @@ DIType DIBuilder::CreateEnumType(TypeEnum *type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DIType DIBuilder::CreatePointerType(TypePointer *type) {
|
DIType DIBuilder::CreatePointerType(TypePointer *type) {
|
||||||
llvm::Type *T = DtoType(type);
|
|
||||||
|
|
||||||
// TODO: The addressspace is important for dcompute targets. See e.g.
|
// TODO: The addressspace is important for dcompute targets. See e.g.
|
||||||
// https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00326.html
|
// https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00326.html
|
||||||
const llvm::Optional<unsigned> DWARFAddressSpace = llvm::None;
|
const llvm::Optional<unsigned> DWARFAddressSpace = llvm::None;
|
||||||
|
@ -380,9 +378,7 @@ DIType DIBuilder::CreatePointerType(TypePointer *type) {
|
||||||
|
|
||||||
return DBuilder.createPointerType(
|
return DBuilder.createPointerType(
|
||||||
CreateTypeDescription(type->nextOf(), /*voidToUbyte=*/true),
|
CreateTypeDescription(type->nextOf(), /*voidToUbyte=*/true),
|
||||||
getTypeAllocSize(T) * 8, // size (bits)
|
target.ptrsize * 8, 0, DWARFAddressSpace, name);
|
||||||
getABITypeAlign(T) * 8, // align (bits)
|
|
||||||
DWARFAddressSpace, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DIType DIBuilder::CreateVectorType(TypeVector *type) {
|
DIType DIBuilder::CreateVectorType(TypeVector *type) {
|
||||||
|
@ -775,9 +771,9 @@ DIType DIBuilder::CreateTypeDescription(Type *t, bool voidToUbyte) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (t->ty == TY::Tnull) {
|
if (t->ty == TY::Tnull) {
|
||||||
// display null as void*
|
// display null as void*
|
||||||
return DBuilder.createPointerType(CreateTypeDescription(Type::tvoid), 8, 8,
|
return DBuilder.createPointerType(
|
||||||
/* DWARFAddressSpace */ llvm::None,
|
CreateTypeDescription(Type::tvoid), target.ptrsize * 8, 0,
|
||||||
"typeof(null)");
|
/* DWARFAddressSpace */ llvm::None, "typeof(null)");
|
||||||
}
|
}
|
||||||
if (auto te = t->isTypeEnum())
|
if (auto te = t->isTypeEnum())
|
||||||
return CreateEnumType(te);
|
return CreateEnumType(te);
|
||||||
|
@ -796,13 +792,11 @@ DIType DIBuilder::CreateTypeDescription(Type *t, bool voidToUbyte) {
|
||||||
if (t->ty == TY::Tstruct)
|
if (t->ty == TY::Tstruct)
|
||||||
return CreateCompositeType(t);
|
return CreateCompositeType(t);
|
||||||
if (auto tc = t->isTypeClass()) {
|
if (auto tc = t->isTypeClass()) {
|
||||||
LLType *T = DtoType(t);
|
|
||||||
const auto aggregateDIType = CreateCompositeType(t);
|
const auto aggregateDIType = CreateCompositeType(t);
|
||||||
const auto name =
|
const auto name =
|
||||||
(tc->sym->toPrettyChars(true) + llvm::StringRef("*")).str();
|
(tc->sym->toPrettyChars(true) + llvm::StringRef("*")).str();
|
||||||
return DBuilder.createPointerType(aggregateDIType, getTypeAllocSize(T) * 8,
|
return DBuilder.createPointerType(aggregateDIType, target.ptrsize * 8, 0,
|
||||||
getABITypeAlign(T) * 8, llvm::None,
|
llvm::None, processDIName(name));
|
||||||
processDIName(name));
|
|
||||||
}
|
}
|
||||||
if (auto tf = t->isTypeFunction())
|
if (auto tf = t->isTypeFunction())
|
||||||
return CreateFunctionType(tf);
|
return CreateFunctionType(tf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue