mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +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) {
|
||||
llvm::Type *T = DtoType(type);
|
||||
|
||||
// TODO: The addressspace is important for dcompute targets. See e.g.
|
||||
// https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00326.html
|
||||
const llvm::Optional<unsigned> DWARFAddressSpace = llvm::None;
|
||||
|
@ -380,9 +378,7 @@ DIType DIBuilder::CreatePointerType(TypePointer *type) {
|
|||
|
||||
return DBuilder.createPointerType(
|
||||
CreateTypeDescription(type->nextOf(), /*voidToUbyte=*/true),
|
||||
getTypeAllocSize(T) * 8, // size (bits)
|
||||
getABITypeAlign(T) * 8, // align (bits)
|
||||
DWARFAddressSpace, name);
|
||||
target.ptrsize * 8, 0, DWARFAddressSpace, name);
|
||||
}
|
||||
|
||||
DIType DIBuilder::CreateVectorType(TypeVector *type) {
|
||||
|
@ -775,9 +771,9 @@ DIType DIBuilder::CreateTypeDescription(Type *t, bool voidToUbyte) {
|
|||
return nullptr;
|
||||
if (t->ty == TY::Tnull) {
|
||||
// display null as void*
|
||||
return DBuilder.createPointerType(CreateTypeDescription(Type::tvoid), 8, 8,
|
||||
/* DWARFAddressSpace */ llvm::None,
|
||||
"typeof(null)");
|
||||
return DBuilder.createPointerType(
|
||||
CreateTypeDescription(Type::tvoid), target.ptrsize * 8, 0,
|
||||
/* DWARFAddressSpace */ llvm::None, "typeof(null)");
|
||||
}
|
||||
if (auto te = t->isTypeEnum())
|
||||
return CreateEnumType(te);
|
||||
|
@ -796,13 +792,11 @@ DIType DIBuilder::CreateTypeDescription(Type *t, bool voidToUbyte) {
|
|||
if (t->ty == TY::Tstruct)
|
||||
return CreateCompositeType(t);
|
||||
if (auto tc = t->isTypeClass()) {
|
||||
LLType *T = DtoType(t);
|
||||
const auto aggregateDIType = CreateCompositeType(t);
|
||||
const auto name =
|
||||
(tc->sym->toPrettyChars(true) + llvm::StringRef("*")).str();
|
||||
return DBuilder.createPointerType(aggregateDIType, getTypeAllocSize(T) * 8,
|
||||
getABITypeAlign(T) * 8, llvm::None,
|
||||
processDIName(name));
|
||||
return DBuilder.createPointerType(aggregateDIType, target.ptrsize * 8, 0,
|
||||
llvm::None, processDIName(name));
|
||||
}
|
||||
if (auto tf = t->isTypeFunction())
|
||||
return CreateFunctionType(tf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue