summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/ProfileData/CoverageMappingReader.cpp15
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp11
2 files changed, 15 insertions, 11 deletions
diff --git a/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp
index 8d1508b0370..3eb87e68db8 100644
--- a/llvm/lib/ProfileData/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingReader.cpp
@@ -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::readMappingRegionsSubArray(
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));
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index ba19e0bc9a9..1a5d6a50f9e 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -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));
OpenPOWER on IntegriCloud