forked from OSchip/llvm-project
Use correct alignment and size for references in records as well.
llvm-svn: 68769
This commit is contained in:
parent
b0001322e0
commit
b36338aa00
|
@ -580,6 +580,10 @@ void ASTRecordLayout::LayoutField(const FieldDecl *FD, unsigned FieldNo,
|
|||
FieldSize = 0;
|
||||
const ArrayType* ATy = Context.getAsArrayType(FD->getType());
|
||||
FieldAlign = Context.getTypeAlign(ATy->getElementType());
|
||||
} else if (const ReferenceType *RT = FD->getType()->getAsReferenceType()) {
|
||||
unsigned AS = RT->getPointeeType().getAddressSpace();
|
||||
FieldSize = Context.Target.getPointerWidth(AS);
|
||||
FieldAlign = Context.Target.getPointerAlign(AS);
|
||||
} else {
|
||||
std::pair<uint64_t, unsigned> FieldInfo =
|
||||
Context.getTypeInfo(FD->getType());
|
||||
|
|
Loading…
Reference in New Issue