diff options
author | hstk30-hw <hanwei62@huawei.com> | 2025-09-17 21:51:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-17 15:51:49 +0200 |
commit | 1f05682d7634d644cd6fd7141c84ee3ab58c26ab (patch) | |
tree | 63090522e304c39af511836507d4e22246fe62d1 /clang/lib/CodeGen/CGDecl.cpp | |
parent | db204d92191b370891ef69c621c092a5c9c417bf (diff) | |
download | llvm-1f05682d7634d644cd6fd7141c84ee3ab58c26ab.zip llvm-1f05682d7634d644cd6fd7141c84ee3ab58c26ab.tar.gz llvm-1f05682d7634d644cd6fd7141c84ee3ab58c26ab.tar.bz2 |
[clang] Remove redundant conditions (NFC) (#159349)
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 29193e0..4e735f6 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -1251,8 +1251,7 @@ void CodeGenFunction::emitStoresForConstant(const VarDecl &D, Address Loc, LangOptions::TrivialAutoVarInitKind::Pattern; if (shouldSplitConstantStore(CGM, ConstantSize)) { if (auto *STy = dyn_cast<llvm::StructType>(Ty)) { - if (STy == Loc.getElementType() || - (STy != Loc.getElementType() && IsTrivialAutoVarInitPattern)) { + if (STy == Loc.getElementType() || IsTrivialAutoVarInitPattern) { const llvm::StructLayout *Layout = CGM.getDataLayout().getStructLayout(STy); for (unsigned i = 0; i != constant->getNumOperands(); i++) { @@ -1266,8 +1265,7 @@ void CodeGenFunction::emitStoresForConstant(const VarDecl &D, Address Loc, return; } } else if (auto *ATy = dyn_cast<llvm::ArrayType>(Ty)) { - if (ATy == Loc.getElementType() || - (ATy != Loc.getElementType() && IsTrivialAutoVarInitPattern)) { + if (ATy == Loc.getElementType() || IsTrivialAutoVarInitPattern) { for (unsigned i = 0; i != ATy->getNumElements(); i++) { Address EltPtr = Builder.CreateConstGEP( Loc.withElementType(ATy->getElementType()), i); |