aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp26
-rw-r--r--lib/AST/RecordLayoutBuilder.h9
2 files changed, 13 insertions, 22 deletions
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index 5463f61f2c..a255ff41ae 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -639,8 +639,7 @@ void ASTRecordLayoutBuilder::Layout(const RecordDecl *D) {
}
// FIXME. Impl is no longer needed.
-void ASTRecordLayoutBuilder::Layout(const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl) {
+void ASTRecordLayoutBuilder::Layout(const ObjCInterfaceDecl *D) {
if (ObjCInterfaceDecl *SD = D->getSuperClass()) {
const ASTRecordLayout &SL = Context.getASTObjCInterfaceLayout(SD);
@@ -913,20 +912,6 @@ ASTRecordLayoutBuilder::ComputeLayout(ASTContext &Ctx,
Builder.Bases, Builder.VBases);
}
-const ASTRecordLayout *
-ASTRecordLayoutBuilder::ComputeLayout(ASTContext &Ctx,
- const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl) {
- ASTRecordLayoutBuilder Builder(Ctx);
-
- Builder.Layout(D, Impl);
-
- return new (Ctx) ASTRecordLayout(Ctx, Builder.Size, Builder.Alignment,
- Builder.DataSize,
- Builder.FieldOffsets.data(),
- Builder.FieldOffsets.size());
-}
-
const CXXMethodDecl *
ASTRecordLayoutBuilder::ComputeKeyFunction(const CXXRecordDecl *RD) {
assert(RD->isDynamicClass() && "Class does not have any virtual methods!");
@@ -1035,8 +1020,15 @@ ASTContext::getObjCLayout(const ObjCInterfaceDecl *D,
return getObjCLayout(D, 0);
}
+ ASTRecordLayoutBuilder Builder(*this);
+ Builder.Layout(D);
+
const ASTRecordLayout *NewEntry =
- ASTRecordLayoutBuilder::ComputeLayout(*this, D, Impl);
+ new (*this) ASTRecordLayout(*this, Builder.Size, Builder.Alignment,
+ Builder.DataSize,
+ Builder.FieldOffsets.data(),
+ Builder.FieldOffsets.size());
+
ObjCLayouts[Key] = NewEntry;
return *NewEntry;
diff --git a/lib/AST/RecordLayoutBuilder.h b/lib/AST/RecordLayoutBuilder.h
index 5d4a74731a..c3a48f7ee7 100644
--- a/lib/AST/RecordLayoutBuilder.h
+++ b/lib/AST/RecordLayoutBuilder.h
@@ -26,6 +26,9 @@ namespace clang {
class RecordDecl;
class ASTRecordLayoutBuilder {
+ // FIXME: Remove this and make the appropriate fields public.
+ friend class ASTContext;
+
ASTContext &Context;
/// Size - The current size of the record layout.
@@ -91,8 +94,7 @@ class ASTRecordLayoutBuilder {
void Layout(const RecordDecl *D);
void Layout(const CXXRecordDecl *D);
- void Layout(const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl);
+ void Layout(const ObjCInterfaceDecl *D);
void LayoutFields(const RecordDecl *D);
void LayoutField(const FieldDecl *D);
@@ -169,9 +171,6 @@ class ASTRecordLayoutBuilder {
public:
static const ASTRecordLayout *ComputeLayout(ASTContext &Ctx,
const RecordDecl *RD);
- static const ASTRecordLayout *ComputeLayout(ASTContext &Ctx,
- const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl);
static const CXXMethodDecl *ComputeKeyFunction(const CXXRecordDecl *RD);
};