From 6277615cbb1cda917dd8815a611fa1146e172af9 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Wed, 24 Nov 2010 19:57:04 +0000 Subject: Simplify code. llvm-svn: 120109 --- clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | 14 +------------- clang/lib/CodeGen/CodeGenTypes.cpp | 8 +------- 2 files changed, 2 insertions(+), 20 deletions(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp index ce42a6aaaac..f846fca5069 100644 --- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -140,9 +140,6 @@ private: unsigned getTypeAlignment(const llvm::Type *Ty) const; - /// getCGRecordLayout - Return the CGRecordLayout for the given record. - const CGRecordLayout &getCGRecordLayout(const CXXRecordDecl *RD); - /// CheckZeroInitializable - Check if the given type contains a pointer /// to data member. void CheckZeroInitializable(QualType T); @@ -689,15 +686,6 @@ unsigned CGRecordLayoutBuilder::getTypeAlignment(const llvm::Type *Ty) const { return Types.getTargetData().getABITypeAlignment(Ty); } -const CGRecordLayout & -CGRecordLayoutBuilder::getCGRecordLayout(const CXXRecordDecl *RD) { - // FIXME: It would be better if there was a way to explicitly compute the - // record layout instead of converting to a type. - Types.ConvertTagDeclType(RD); - - return Types.getCGRecordLayout(RD); -} - void CGRecordLayoutBuilder::CheckZeroInitializable(QualType T) { // This record already contains a member pointer. if (!IsZeroInitializable) @@ -723,7 +711,7 @@ void CGRecordLayoutBuilder::CheckZeroInitializable(const CXXRecordDecl *RD) { if (!IsZeroInitializable) return; - const CGRecordLayout &Layout = getCGRecordLayout(RD); + const CGRecordLayout &Layout = Types.getCGRecordLayout(RD); if (!Layout.isZeroInitializable()) IsZeroInitializable = false; } diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index ea7d18f0ca0..fb1a6d8f13d 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -524,11 +524,5 @@ bool CodeGenTypes::isZeroInitializable(QualType T) { } bool CodeGenTypes::isZeroInitializable(const CXXRecordDecl *RD) { - - // FIXME: It would be better if there was a way to explicitly compute the - // record layout instead of converting to a type. - ConvertTagDeclType(RD); - - const CGRecordLayout &Layout = getCGRecordLayout(RD); - return Layout.isZeroInitializable(); + return getCGRecordLayout(RD).isZeroInitializable(); } -- cgit v1.2.3