From ceee5e813364a34db3ad99926fd05dce69e4bb44 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. llvm-svn: 131447 --- clang/lib/CodeGen/TargetInfo.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'clang/lib/CodeGen/TargetInfo.cpp') diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index bc2472cebbe..3c18b0b1083 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/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