[Analysis] Fix gcc warnings about unused variables [NFC]
gcc warned with:
[236/4788] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LazyValueInfo.cpp.o
../lib/Analysis/LazyValueInfo.cpp: In member function 'void llvm::LazyValueInfo::forgetValue(llvm::Value*)':
../lib/Analysis/LazyValueInfo.cpp:1978:13: warning: unused variable 'Impl' [-Wunused-variable]
1978 | if (auto *Impl = getImpl())
| ^~~~
../lib/Analysis/LazyValueInfo.cpp: In member function 'void llvm::LazyValueInfo::eraseBlock(llvm::BasicBlock*)':
../lib/Analysis/LazyValueInfo.cpp:1983:13: warning: unused variable 'Impl' [-Wunused-variable]
1983 | if (auto *Impl = getImpl())
| ^~~~
../lib/Analysis/LazyValueInfo.cpp: In member function 'void llvm::LazyValueInfo::clear()':
../lib/Analysis/LazyValueInfo.cpp:1988:13: warning: unused variable 'Impl' [-Wunused-variable]
1988 | if (auto *Impl = getImpl())
| ^~~~
../lib/Analysis/LazyValueInfo.cpp: In member function 'void llvm::LazyValueInfo::printLVI(llvm::Function&, llvm::DominatorTree&, llvm::raw_ostream&)':
../lib/Analysis/LazyValueInfo.cpp:1993:13: warning: unused variable 'Impl' [-Wunused-variable]
1993 | if (auto *Impl = getImpl())
| ^~~~
Use the locals instead of calling getImpl() again.
GitOrigin-RevId: ee1a06b80fb70a015d0b8a6be55124df3575622a
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 80136a0..0892aa9d 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -1976,22 +1976,22 @@
void LazyValueInfo::forgetValue(Value *V) {
if (auto *Impl = getImpl())
- getImpl()->forgetValue(V);
+ Impl->forgetValue(V);
}
void LazyValueInfo::eraseBlock(BasicBlock *BB) {
if (auto *Impl = getImpl())
- getImpl()->eraseBlock(BB);
+ Impl->eraseBlock(BB);
}
void LazyValueInfo::clear() {
if (auto *Impl = getImpl())
- getImpl()->clear();
+ Impl->clear();
}
void LazyValueInfo::printLVI(Function &F, DominatorTree &DTree, raw_ostream &OS) {
if (auto *Impl = getImpl())
- getImpl()->printLVI(F, DTree, OS);
+ Impl->printLVI(F, DTree, OS);
}
// Print the LVI for the function arguments at the start of each basic block.