aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-07-31 11:24:33 -0700
committerKazu Hirata <kazu@google.com>2025-07-31 11:24:33 -0700
commit3a18fe33f0763cd9276c99c276448412100f6270 (patch)
treeccfeece2e69849aeb4585e61da21366d90d339cd /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent078d214672e23691566137fa88b851c7022666b7 (diff)
downloadllvm-3a18fe33f0763cd9276c99c276448412100f6270.zip
llvm-3a18fe33f0763cd9276c99c276448412100f6270.tar.gz
llvm-3a18fe33f0763cd9276c99c276448412100f6270.tar.bz2
[Utils] Fix a warning
This patch fixes: llvm/lib/Transforms/Utils/LoopUtils.cpp:818:28: error: unused function 'operator<<' [-Werror,-Wunused-function]
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 9043baa..6327b92 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -815,11 +815,14 @@ struct DbgLoop {
const Loop *L;
explicit DbgLoop(const Loop *L) : L(L) {}
};
+
+#ifndef NDEBUG
static inline raw_ostream &operator<<(raw_ostream &OS, DbgLoop D) {
OS << "function ";
D.L->getHeader()->getParent()->printAsOperand(OS, /*PrintType=*/false);
return OS << " " << *D.L;
}
+#endif // NDEBUG
static std::optional<unsigned> estimateLoopTripCount(Loop *L) {
// Currently we take the estimate exit count only from the loop latch,