[llvm] ec00aa9 - [DomTreeUpdater] Use const auto * when iterating over pointers (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 08:40:34 PDT 2020
Author: Florian Hahn
Date: 2020-07-10T16:39:15+01:00
New Revision: ec00aa99dd4cd46c328219cffefcfdf8a8bd53a0
URL: https://github.com/llvm/llvm-project/commit/ec00aa99dd4cd46c328219cffefcfdf8a8bd53a0
DIFF: https://github.com/llvm/llvm-project/commit/ec00aa99dd4cd46c328219cffefcfdf8a8bd53a0.diff
LOG: [DomTreeUpdater] Use const auto * when iterating over pointers (NFC).
This silences the warning below:
llvm-project/llvm/lib/Analysis/DomTreeUpdater.cpp:510:20: warning: loop variable 'BB' is always a copy because the range of type 'const SmallPtrSet<llvm::BasicBlock *, 8>' does not return a reference [-Wrange-loop-analysis]
for (const auto &BB : DeletedBBs) {
^
llvm-project/llvm/lib/Analysis/DomTreeUpdater.cpp:510:8: note: use non-reference type 'llvm::BasicBlock *'
for (const auto &BB : DeletedBBs) {
^~~~~~~~~~~~~~~~
1 warning generated.
Added:
Modified:
llvm/lib/Analysis/DomTreeUpdater.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/DomTreeUpdater.cpp b/llvm/lib/Analysis/DomTreeUpdater.cpp
index 26e637bb6d99..9594da0a4f91 100644
--- a/llvm/lib/Analysis/DomTreeUpdater.cpp
+++ b/llvm/lib/Analysis/DomTreeUpdater.cpp
@@ -507,7 +507,7 @@ LLVM_DUMP_METHOD void DomTreeUpdater::dump() const {
OS << "Pending DeletedBBs:\n";
Index = 0;
- for (const auto &BB : DeletedBBs) {
+ for (const auto *BB : DeletedBBs) {
OS << " " << Index << " : ";
++Index;
if (BB->hasName())
More information about the llvm-commits
mailing list