[cfe-commits] r68769 - /cfe/trunk/lib/AST/ASTContext.cpp
Anders Carlsson
andersca at mac.com
Thu Apr 9 22:31:16 PDT 2009
Author: andersca
Date: Fri Apr 10 00:31:15 2009
New Revision: 68769
URL: http://llvm.org/viewvc/llvm-project?rev=68769&view=rev
Log:
Use correct alignment and size for references in records as well.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=68769&r1=68768&r2=68769&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Apr 10 00:31:15 2009
@@ -580,6 +580,10 @@
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());
More information about the cfe-commits
mailing list