From b7d2516f5dd1e5dfb112fc4e273db16f636b7fdc Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 17 May 2011 00:46:40 +0000 Subject: Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131447 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/TargetInfo.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/TargetInfo.cpp') diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index bc2472cebb..3c18b0b108 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -128,12 +128,9 @@ static bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays) { if (RD->hasFlexibleArrayMember()) return false; - // If this is a C++ record, check the bases first. + // If this is a C++ record, check if it is empty. if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) - for (CXXRecordDecl::base_class_const_iterator i = CXXRD->bases_begin(), - e = CXXRD->bases_end(); i != e; ++i) - if (!isEmptyRecord(Context, i->getType(), true)) - return false; + return CXXRD->isEmpty(); for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) -- cgit v1.2.3-18-g5258