forked from OSchip/llvm-project
[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)) { | ^~~~~~~~~~~~~ ```
This commit is contained in:
parent
e96d6f4821
commit
f2264ebb08
|
@ -710,7 +710,7 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
|
|||
// fold it if the resulting pointer operand is a GlobalValue. Otherwise
|
||||
// there is nothing else to simplify since the GEP is already in the
|
||||
// most simplified form.
|
||||
if (auto *SimplifiedGEP = dyn_cast<GEPOperator>(Simplified)) {
|
||||
if (isa<GEPOperator>(Simplified)) {
|
||||
if (auto *GV = dyn_cast<GlobalVariable>(Simplified->getOperand(0))) {
|
||||
if (GV->isConstant() && GV->hasDefinitiveInitializer()) {
|
||||
if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(
|
||||
|
|
Loading…
Reference in New Issue