diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-09-15 22:23:29 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-09-15 22:23:29 +0000 |
commit | 92bb302314b7074b1ccdff4857a2657baa5f9b3f (patch) | |
tree | 5b647bc6358cdf88b5924ab8bc7638ef787f91eb /llvm/tools/llvm-cov/SourceCoverageView.cpp | |
parent | 8dee57a75ddb44842777fb8def914efc15387894 (diff) | |
download | bcm5719-llvm-92bb302314b7074b1ccdff4857a2657baa5f9b3f.tar.gz bcm5719-llvm-92bb302314b7074b1ccdff4857a2657baa5f9b3f.zip |
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
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageView.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp index 7c6d9a5c0f3..202475a7562 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp @@ -49,6 +49,18 @@ void SourceCoverageView::renderLine(raw_ostream &OS, StringRef Line, // 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 @@ SourceCoverageView::createHighlightRanges(SourceCoverageDataManager &Data) { } 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) { |