aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-05-26 15:32:58 +0000
committerAnders Carlsson <andersca@mac.com>2010-05-26 15:32:58 +0000
commit6a91c0328c81fe1be4e5380fb0e586cafee53b26 (patch)
tree4bf6d8f8d3341983548413e07b1f266ab1b4bcf4
parent0efac254e385f06e34158aaa351942c80149042f (diff)
Stub out the EmptySubobjectsMap class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104701 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index 259606d057..69aa0113b4 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -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 @@ class RecordLayoutBuilder {
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 RecordDecl *D) {
}
void RecordLayoutBuilder::Layout(const CXXRecordDecl *RD) {
+ // Create our empty subobject offset map.
+ EmptySubobjectMap EmptySubobjectMap(Context, RD);
+ EmptySubobjects = &EmptySubobjectMap;
+
InitializeLayout(RD);
ComputeEmptySubobjectSizes(RD);