From b0f4fcf84e1d31e046e96c67b2e6e64c0088b6fa Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 10 Jul 2020 16:39:15 +0100 Subject: [PATCH] [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' 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. --- lib/Analysis/DomTreeUpdater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Analysis/DomTreeUpdater.cpp b/lib/Analysis/DomTreeUpdater.cpp index 26e637bb6d9..9594da0a4f9 100644 --- a/lib/Analysis/DomTreeUpdater.cpp +++ b/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())