Skip to content

Commit ee1a06b

Browse files
committed
[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.
1 parent 739c86d commit ee1a06b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Analysis/LazyValueInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,22 +1976,22 @@ void LazyValueInfo::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc,
19761976

19771977
void LazyValueInfo::forgetValue(Value *V) {
19781978
if (auto *Impl = getImpl())
1979-
getImpl()->forgetValue(V);
1979+
Impl->forgetValue(V);
19801980
}
19811981

19821982
void LazyValueInfo::eraseBlock(BasicBlock *BB) {
19831983
if (auto *Impl = getImpl())
1984-
getImpl()->eraseBlock(BB);
1984+
Impl->eraseBlock(BB);
19851985
}
19861986

19871987
void LazyValueInfo::clear() {
19881988
if (auto *Impl = getImpl())
1989-
getImpl()->clear();
1989+
Impl->clear();
19901990
}
19911991

19921992
void LazyValueInfo::printLVI(Function &F, DominatorTree &DTree, raw_ostream &OS) {
19931993
if (auto *Impl = getImpl())
1994-
getImpl()->printLVI(F, DTree, OS);
1994+
Impl->printLVI(F, DTree, OS);
19951995
}
19961996

19971997
// Print the LVI for the function arguments at the start of each basic block.

0 commit comments

Comments
 (0)