Skip to content

Commit f2264eb

Browse files
committed
[ConstantFolding] Fix -Wunused-variable warning (NFC)
GCC warning: ``` /llvm-project/llvm/lib/Analysis/ConstantFolding.cpp: In function ‘llvm::Constant* llvm::ConstantFoldLoadFromConstPtr(llvm::Constant*, llvm::Type*, const llvm::DataLayout&)’: /llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:713:19: warning: unused variable ‘SimplifiedGEP’ [-Wunused-variable] 713 | if (auto *SimplifiedGEP = dyn_cast<GEPOperator>(Simplified)) { | ^~~~~~~~~~~~~ ```
1 parent e96d6f4 commit f2264eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
710710
// fold it if the resulting pointer operand is a GlobalValue. Otherwise
711711
// there is nothing else to simplify since the GEP is already in the
712712
// most simplified form.
713-
if (auto *SimplifiedGEP = dyn_cast<GEPOperator>(Simplified)) {
713+
if (isa<GEPOperator>(Simplified)) {
714714
if (auto *GV = dyn_cast<GlobalVariable>(Simplified->getOperand(0))) {
715715
if (GV->isConstant() && GV->hasDefinitiveInitializer()) {
716716
if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(

0 commit comments

Comments
 (0)