Skip to content

Commit 3a18fe3

Browse files
[Utils] Fix a warning
This patch fixes: llvm/lib/Transforms/Utils/LoopUtils.cpp:818:28: error: unused function 'operator<<' [-Werror,-Wunused-function]
1 parent 078d214 commit 3a18fe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Utils/LoopUtils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,11 +815,14 @@ struct DbgLoop {
815815
const Loop *L;
816816
explicit DbgLoop(const Loop *L) : L(L) {}
817817
};
818+
819+
#ifndef NDEBUG
818820
static inline raw_ostream &operator<<(raw_ostream &OS, DbgLoop D) {
819821
OS << "function ";
820822
D.L->getHeader()->getParent()->printAsOperand(OS, /*PrintType=*/false);
821823
return OS << " " << *D.L;
822824
}
825+
#endif // NDEBUG
823826

824827
static std::optional<unsigned> estimateLoopTripCount(Loop *L) {
825828
// Currently we take the estimate exit count only from the loop latch,

0 commit comments

Comments
 (0)