[cfe-commits] r82831 - in /cfe/trunk: lib/AST/RecordLayoutBuilder.cpp test/SemaCXX/empty-class-layout.cpp
Anders Carlsson
andersca at mac.com
Fri Sep 25 18:29:10 PDT 2009
Author: andersca
Date: Fri Sep 25 20:29:10 2009
New Revision: 82831
URL: http://llvm.org/viewvc/llvm-project?rev=82831&view=rev
Log:
Start at NextOffset when laying out bases as well.
Modified:
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
cfe/trunk/test/SemaCXX/empty-class-layout.cpp
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=82831&r1=82830&r2=82831&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Fri Sep 25 20:29:10 2009
@@ -377,7 +377,7 @@
unsigned BaseAlign = BaseInfo.getNonVirtualAlign();
// Round up the current record size to the base's alignment boundary.
- uint64_t Offset = llvm::RoundUpToAlignment(Size, BaseAlign);
+ uint64_t Offset = llvm::RoundUpToAlignment(NextOffset, BaseAlign);
// Try to place the base.
while (true) {
Modified: cfe/trunk/test/SemaCXX/empty-class-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/empty-class-layout.cpp?rev=82831&r1=82830&r2=82831&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/empty-class-layout.cpp (original)
+++ cfe/trunk/test/SemaCXX/empty-class-layout.cpp Fri Sep 25 20:29:10 2009
@@ -62,3 +62,7 @@
void *v;
};
SA(11, sizeof(S7) == 8);
+
+struct S8 : Empty, A {
+};
+SA(12, sizeof(S8) == 4);
More information about the cfe-commits
mailing list