Move BaseInfo outside of the EmptySubobject class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105002 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index 0ede4bc..a2cf28d 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -23,6 +23,16 @@
namespace {
+struct BaseInfo {
+ const CXXRecordDecl *Class;
+ bool IsVirtual;
+
+ const CXXRecordDecl *PrimaryVirtualBase;
+
+ llvm::SmallVector<BaseInfo*, 4> Bases;
+ const BaseInfo *Derived;
+};
+
/// EmptySubobjectMap - Keeps track of which empty subobjects exist at different
/// offsets while laying out a C++ class.
class EmptySubobjectMap {
@@ -40,16 +50,6 @@
/// member subobject that is empty.
void ComputeEmptySubobjectSizes();
- struct BaseInfo {
- const CXXRecordDecl *Class;
- bool IsVirtual;
-
- const CXXRecordDecl *PrimaryVirtualBase;
-
- llvm::SmallVector<BaseInfo*, 4> Bases;
- const BaseInfo *Derived;
- };
-
llvm::DenseMap<const CXXRecordDecl *, BaseInfo *> VirtualBaseInfo;
llvm::DenseMap<const CXXRecordDecl *, BaseInfo *> NonVirtualBaseInfo;
@@ -148,9 +148,9 @@
}
}
-EmptySubobjectMap::BaseInfo *
-EmptySubobjectMap::ComputeBaseInfo(const CXXRecordDecl *RD, bool IsVirtual,
- const BaseInfo *Derived) {
+BaseInfo *EmptySubobjectMap::ComputeBaseInfo(const CXXRecordDecl *RD,
+ bool IsVirtual,
+ const BaseInfo *Derived) {
BaseInfo *Info;
if (IsVirtual) {