summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-05-26 05:04:25 +0000
committerAnders Carlsson <andersca@mac.com>2010-05-26 05:04:25 +0000
commit6ed3a9a4942d81e2ce6e70a36972f3aa35a14e00 (patch)
tree616c998df0d8522ce95050fbeae83e4f78400a8a /clang/lib/AST/RecordLayoutBuilder.cpp
parentdf291d8d8b04259bb4193912e0f4e432e4162f70 (diff)
downloadbcm5719-llvm-6ed3a9a4942d81e2ce6e70a36972f3aa35a14e00.tar.gz
bcm5719-llvm-6ed3a9a4942d81e2ce6e70a36972f3aa35a14e00.zip
Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.
llvm-svn: 104672
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 5463f61f2c5..a255ff41ae3 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud