summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-01 21:50:30 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-01 21:50:30 +0000
commitf7133b797749c4edd91d4ddd8a7a64e319650fad (patch)
tree3c24ada23fe6ef1c29d1c211cd725ecc4466e5a8
parented1178689f9f04b41519ec7fd7496ec21592aaf8 (diff)
downloadbcm5719-llvm-f7133b797749c4edd91d4ddd8a7a64e319650fad.tar.gz
bcm5719-llvm-f7133b797749c4edd91d4ddd8a7a64e319650fad.zip
CGExprAgg - remove duplicate code. NFCI.
Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning. llvm-svn: 373396
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 0a57870a7c5..9610a04be34 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -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;
OpenPOWER on IntegriCloud