mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 10:53:55 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218183 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31235e5b94
commit
73edcffc8f
@ -15,12 +15,15 @@
|
|||||||
#include "llvm/ProfileData/CoverageMappingReader.h"
|
#include "llvm/ProfileData/CoverageMappingReader.h"
|
||||||
#include "llvm/ADT/DenseSet.h"
|
#include "llvm/ADT/DenseSet.h"
|
||||||
#include "llvm/Object/ObjectFile.h"
|
#include "llvm/Object/ObjectFile.h"
|
||||||
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/LEB128.h"
|
#include "llvm/Support/LEB128.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace coverage;
|
using namespace coverage;
|
||||||
using namespace object;
|
using namespace object;
|
||||||
|
|
||||||
|
#define DEBUG_TYPE "coverage-mapping"
|
||||||
|
|
||||||
void CoverageMappingIterator::increment() {
|
void CoverageMappingIterator::increment() {
|
||||||
// Check if all the records were read or if an error occurred while reading
|
// Check if all the records were read or if an error occurred while reading
|
||||||
// the next record.
|
// the next record.
|
||||||
@ -198,6 +201,18 @@ std::error_code RawCoverageMappingReader::readMappingRegionsSubArray(
|
|||||||
ColumnStart = 1;
|
ColumnStart = 1;
|
||||||
ColumnEnd = std::numeric_limits<unsigned>::max();
|
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(
|
MappingRegions.push_back(CounterMappingRegion(
|
||||||
C, InferredFileID, LineStart, ColumnStart, LineStart + NumLines,
|
C, InferredFileID, LineStart, ColumnStart, LineStart + NumLines,
|
||||||
ColumnEnd, HasCodeBefore, Kind));
|
ColumnEnd, HasCodeBefore, Kind));
|
||||||
|
@ -381,17 +381,6 @@ bool CodeCoverageTool::load() {
|
|||||||
bool RegionError = false;
|
bool RegionError = false;
|
||||||
CounterMappingContext Ctx(I.Expressions, Counts);
|
CounterMappingContext Ctx(I.Expressions, Counts);
|
||||||
for (const auto &R : I.MappingRegions) {
|
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);
|
ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(R.Count);
|
||||||
if (ExecutionCount) {
|
if (ExecutionCount) {
|
||||||
Function.CountedRegions.push_back(CountedRegion(R, *ExecutionCount));
|
Function.CountedRegions.push_back(CountedRegion(R, *ExecutionCount));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user