[llvm] r218183 - llvm-cov: Move some reader debug output out of the tool.
Justin Bogner
mail at justinbogner.com
Sat Sep 20 08:31:51 PDT 2014
Author: bogner
Date: Sat Sep 20 10:31:51 2014
New Revision: 218183
URL: http://llvm.org/viewvc/llvm-project?rev=218183&view=rev
Log:
llvm-cov: Move some reader debug output out of the tool.
This debug output is really for testing CoverageMappingReader, not the
llvm-cov tool. Move it to where it can be more useful.
Modified:
llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp
llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
Modified: llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp?rev=218183&r1=218182&r2=218183&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp Sat Sep 20 10:31:51 2014
@@ -15,12 +15,15 @@
#include "llvm/ProfileData/CoverageMappingReader.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/LEB128.h"
using namespace llvm;
using namespace coverage;
using namespace object;
+#define DEBUG_TYPE "coverage-mapping"
+
void CoverageMappingIterator::increment() {
// Check if all the records were read or if an error occurred while reading
// the next record.
@@ -198,6 +201,18 @@ std::error_code RawCoverageMappingReader
ColumnStart = 1;
ColumnEnd = std::numeric_limits<unsigned>::max();
}
+
+ DEBUG({
+ dbgs() << "Counter in file " << InferredFileID << " " << LineStart << ":"
+ << ColumnStart << " -> " << (LineStart + NumLines) << ":"
+ << ColumnEnd << ", ";
+ if (Kind == CounterMappingRegion::ExpansionRegion)
+ dbgs() << "Expands to file " << ExpandedFileID;
+ else
+ CounterMappingContext(Expressions).dump(C, dbgs());
+ dbgs() << "\n";
+ });
+
MappingRegions.push_back(CounterMappingRegion(
C, InferredFileID, LineStart, ColumnStart, LineStart + NumLines,
ColumnEnd, HasCodeBefore, Kind));
Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=218183&r1=218182&r2=218183&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Sat Sep 20 10:31:51 2014
@@ -381,17 +381,6 @@ bool CodeCoverageTool::load() {
bool RegionError = false;
CounterMappingContext Ctx(I.Expressions, Counts);
for (const auto &R : I.MappingRegions) {
- // Compute the values of mapped regions
- if (ViewOpts.Debug) {
- errs() << "File " << R.FileID << "| " << R.LineStart << ":"
- << R.ColumnStart << " -> " << R.LineEnd << ":" << R.ColumnEnd
- << " = ";
- Ctx.dump(R.Count);
- if (R.Kind == CounterMappingRegion::ExpansionRegion) {
- errs() << " (Expanded file id = " << R.ExpandedFileID << ") ";
- }
- errs() << "\n";
- }
ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(R.Count);
if (ExecutionCount) {
Function.CountedRegions.push_back(CountedRegion(R, *ExecutionCount));
More information about the llvm-commits
mailing list