CGExprAgg - remove duplicate code. NFCI.

Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning.

llvm-svn: 373396
This commit is contained in:
Simon Pilgrim 2019-10-01 21:50:30 +00:00
parent ed1178689f
commit f7133b7977
1 changed files with 1 additions and 1 deletions

View File

@ -1759,7 +1759,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) {
// referencee. InitListExprs for unions and arrays can't have references.
if (const RecordType *RT = E->getType()->getAs<RecordType>()) {
if (!RT->isUnionType()) {
RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl();
RecordDecl *SD = RT->getDecl();
CharUnits NumNonZeroBytes = CharUnits::Zero();
unsigned ILEElement = 0;