Skip to content

Commit 1f05682

Browse files
authored
[clang] Remove redundant conditions (NFC) (#159349)
1 parent db204d9 commit 1f05682

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/CodeGen/CGDecl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,7 @@ void CodeGenFunction::emitStoresForConstant(const VarDecl &D, Address Loc,
12511251
LangOptions::TrivialAutoVarInitKind::Pattern;
12521252
if (shouldSplitConstantStore(CGM, ConstantSize)) {
12531253
if (auto *STy = dyn_cast<llvm::StructType>(Ty)) {
1254-
if (STy == Loc.getElementType() ||
1255-
(STy != Loc.getElementType() && IsTrivialAutoVarInitPattern)) {
1254+
if (STy == Loc.getElementType() || IsTrivialAutoVarInitPattern) {
12561255
const llvm::StructLayout *Layout =
12571256
CGM.getDataLayout().getStructLayout(STy);
12581257
for (unsigned i = 0; i != constant->getNumOperands(); i++) {
@@ -1266,8 +1265,7 @@ void CodeGenFunction::emitStoresForConstant(const VarDecl &D, Address Loc,
12661265
return;
12671266
}
12681267
} else if (auto *ATy = dyn_cast<llvm::ArrayType>(Ty)) {
1269-
if (ATy == Loc.getElementType() ||
1270-
(ATy != Loc.getElementType() && IsTrivialAutoVarInitPattern)) {
1268+
if (ATy == Loc.getElementType() || IsTrivialAutoVarInitPattern) {
12711269
for (unsigned i = 0; i != ATy->getNumElements(); i++) {
12721270
Address EltPtr = Builder.CreateConstGEP(
12731271
Loc.withElementType(ATy->getElementType()), i);

0 commit comments

Comments
 (0)