[LoopFusion] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build
authorFangrui Song <maskray@google.com>
Sat, 24 Aug 2019 02:50:42 +0000 (02:50 +0000)
committerFangrui Song <maskray@google.com>
Sat, 24 Aug 2019 02:50:42 +0000 (02:50 +0000)
llvm-svn: 369836

llvm/lib/Transforms/Scalar/LoopFuse.cpp

index 704a71e1c5cf074b77b5e32a08dbbd4079d86cbe..3892d09bc7d7eec700bac2bb85eccb76a1985f42 100644 (file)
@@ -354,15 +354,15 @@ using LoopVector = SmallVector<Loop *, 4>;
 using FusionCandidateSet = std::set<FusionCandidate, FusionCandidateCompare>;
 using FusionCandidateCollection = SmallVector<FusionCandidateSet, 4>;
 
-inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
+#if !defined(NDEBUG)
+static llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
                                      const FusionCandidateSet &CandSet) {
-  for (auto IT : CandSet)
-    OS << IT << "\n";
+  for (const FusionCandidate &FC : CandSet)
+    OS << FC << '\n';
 
   return OS;
 }
 
-#if !defined(NDEBUG)
 static void
 printFusionCandidates(const FusionCandidateCollection &FusionCandidates) {
   dbgs() << "Fusion Candidates: \n";