mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 11:56:12 +03:00
[fix: handle unsized IR field types]
This commit is contained in:
parent
bd5fab1f06
commit
372d6b4983
3 changed files with 7 additions and 24 deletions
|
@ -1321,24 +1321,6 @@ void DtoSetFuncDeclIntrinsicName(TemplateInstance *ti, TemplateDeclaration *td,
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
size_t getMemberSize(Type *type) {
|
||||
const dinteger_t dSize = type->size();
|
||||
llvm::Type *const llType = DtoType(type);
|
||||
if (!llType->isSized()) {
|
||||
// Forward reference in a cycle or similar, we need to trust the D type.
|
||||
return dSize;
|
||||
}
|
||||
|
||||
const uint64_t llSize = gDataLayout->getTypeAllocSize(llType);
|
||||
assert(llSize <= dSize &&
|
||||
"LLVM type is bigger than the corresponding D type, "
|
||||
"might lead to aggregate layout mismatch.");
|
||||
|
||||
return llSize;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Type *stripModifiers(Type *type, bool transitive) {
|
||||
if (type->ty == TY::Tfunction) {
|
||||
return type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue