llvm-cov: Make debug output more consistent

This changes the debug output of the llvm-cov tool to consistently
write to stderr, and moves the highlighting output closer to where
it's relevant.

llvm-svn: 217838
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index 7c6d9a5..202475a 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -49,6 +49,18 @@
   // Show the rest of the line
   OS << Line.substr(Start - 1, Line.size() - Start + 1);
   OS << "\n";
+
+  if (Options.Debug) {
+    for (const auto &Range : Ranges) {
+      errs() << "Highlighted line " << Range.Line << ", " << Range.ColumnStart
+             << " -> ";
+      if (Range.ColumnEnd == std::numeric_limits<unsigned>::max()) {
+        errs() << "?\n";
+      } else {
+        errs() << Range.ColumnEnd << "\n";
+      }
+    }
+  }
 }
 
 void SourceCoverageView::renderOffset(raw_ostream &OS, unsigned I) {
@@ -390,18 +402,6 @@
   }
 
   std::sort(HighlightRanges.begin(), HighlightRanges.end());
-
-  if (Options.Debug) {
-    for (const auto &Range : HighlightRanges) {
-      outs() << "Highlighted line " << Range.Line << ", " << Range.ColumnStart
-             << " -> ";
-      if (Range.ColumnEnd == std::numeric_limits<unsigned>::max()) {
-        outs() << "?\n";
-      } else {
-        outs() << Range.ColumnEnd << "\n";
-      }
-    }
-  }
 }
 
 void SourceCoverageView::createRegionMarkers(SourceCoverageDataManager &Data) {