]> granicus.if.org Git - clang/commitdiff
Simplify code.
authorAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 19:57:04 +0000 (19:57 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 19:57:04 +0000 (19:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120109 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGRecordLayoutBuilder.cpp
lib/CodeGen/CodeGenTypes.cpp

index ce42a6aaaac91d9793ffa57a40cf8a1051ad4a94..f846fca50691b3439b52e8116882bc0d3f94d494 100644 (file)
@@ -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;
 }
index ea7d18f0ca03cfb643f844b5b06c1842d29a5d77..fb1a6d8f13d96af7a3ded24fcdfad39ea9788e70 100644 (file)
@@ -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();
 }