[Utils] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Utils/LoopUtils.cpp:818:28: error: unused
  function 'operator<<' [-Werror,-Wunused-function]
This commit is contained in:
Kazu Hirata 2025-07-31 11:24:33 -07:00
parent 078d214672
commit 3a18fe33f0

View File

@ -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,