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;
|
FieldSize = 0;
|
||||||
const ArrayType* ATy = Context.getAsArrayType(FD->getType());
|
const ArrayType* ATy = Context.getAsArrayType(FD->getType());
|
||||||
FieldAlign = Context.getTypeAlign(ATy->getElementType());
|
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 {
|
} else {
|
||||||
std::pair<uint64_t, unsigned> FieldInfo =
|
std::pair<uint64_t, unsigned> FieldInfo =
|
||||||
Context.getTypeInfo(FD->getType());
|
Context.getTypeInfo(FD->getType());
|
||||||
|
|
Loading…
Reference in New Issue