[cfe-commits] r104701 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Anders Carlsson
andersca at mac.com
Wed May 26 08:32:58 PDT 2010
Author: andersca
Date: Wed May 26 10:32:58 2010
New Revision: 104701
URL: http://llvm.org/viewvc/llvm-project?rev=104701&view=rev
Log:
Stub out the EmptySubobjectsMap class.
Modified:
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=104701&r1=104700&r2=104701&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Wed May 26 10:32:58 2010
@@ -22,12 +22,29 @@
using namespace clang;
namespace {
+
+/// EmptySubobjectMap - Keeps track of which empty subobjects exist at different
+/// offsets while laying out a C++ class.
+class EmptySubobjectMap {
+ ASTContext &Context;
+
+ /// Class - The class whose empty entries we're keeping track of.
+ const CXXRecordDecl *Class;
+
+public:
+ EmptySubobjectMap(ASTContext &Context, const CXXRecordDecl *Class)
+ : Context(Context), Class(Class) { }
+
+};
+
class RecordLayoutBuilder {
// FIXME: Remove this and make the appropriate fields public.
friend class clang::ASTContext;
ASTContext &Context;
+ EmptySubobjectMap *EmptySubobjects;
+
/// Size - The current size of the record layout.
uint64_t Size;
@@ -94,8 +111,8 @@
EmptyClassOffsetsTy EmptyClassOffsets;
RecordLayoutBuilder(ASTContext &Context)
- : Context(Context), Size(0), Alignment(8), Packed(false),
- UnfilledBitsInLastByte(0), MaxFieldAlignment(0), DataSize(0),
+ : Context(Context), EmptySubobjects(0), Size(0), Alignment(8),
+ Packed(false), UnfilledBitsInLastByte(0), MaxFieldAlignment(0), DataSize(0),
IsUnion(false), NonVirtualSize(0), NonVirtualAlignment(8), PrimaryBase(0),
PrimaryBaseIsVirtual(false), FirstNearlyEmptyVBase(0),
SizeOfLargestEmptySubobject(0) { }
@@ -757,6 +774,10 @@
}
void RecordLayoutBuilder::Layout(const CXXRecordDecl *RD) {
+ // Create our empty subobject offset map.
+ EmptySubobjectMap EmptySubobjectMap(Context, RD);
+ EmptySubobjects = &EmptySubobjectMap;
+
InitializeLayout(RD);
ComputeEmptySubobjectSizes(RD);
More information about the cfe-commits
mailing list