diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-17 00:46:40 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-17 00:46:40 +0000 |
commit | b7d2516f5dd1e5dfb112fc4e273db16f636b7fdc (patch) | |
tree | 75033860b3e8804577d94a96d1532b40b422fde4 /lib/CodeGen/TargetInfo.cpp | |
parent | 2636197098e02fd7c90f9496056b8ab886dcbff0 (diff) |
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
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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<CXXRecordDecl>(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) |