2018-01-04 20:33:29 +01:00
|
|
|
//===- CoverageExporter.h - Code coverage exporter ------------------------===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-01-04 20:33:29 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class defines a code coverage exporter interface.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_COV_COVERAGEEXPORTER_H
|
|
|
|
#define LLVM_COV_COVERAGEEXPORTER_H
|
|
|
|
|
2018-04-09 17:20:35 +02:00
|
|
|
#include "CoverageFilters.h"
|
2018-01-04 20:33:29 +01:00
|
|
|
#include "CoverageSummaryInfo.h"
|
|
|
|
#include "CoverageViewOptions.h"
|
|
|
|
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Exports the code coverage information.
|
2018-01-04 20:33:29 +01:00
|
|
|
class CoverageExporter {
|
|
|
|
protected:
|
2018-05-01 17:54:18 +02:00
|
|
|
/// The full CoverageMapping object to export.
|
2018-01-04 20:33:29 +01:00
|
|
|
const coverage::CoverageMapping &Coverage;
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// The options passed to the tool.
|
2018-01-04 20:33:29 +01:00
|
|
|
const CoverageViewOptions &Options;
|
|
|
|
|
2018-09-12 23:59:38 +02:00
|
|
|
/// Output stream to print to.
|
2018-01-04 20:33:29 +01:00
|
|
|
raw_ostream &OS;
|
|
|
|
|
|
|
|
CoverageExporter(const coverage::CoverageMapping &CoverageMapping,
|
|
|
|
const CoverageViewOptions &Options, raw_ostream &OS)
|
|
|
|
: Coverage(CoverageMapping), Options(Options), OS(OS) {}
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~CoverageExporter(){};
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Render the CoverageMapping object.
|
2019-10-30 06:38:38 +01:00
|
|
|
virtual void renderRoot(const CoverageFilters &IgnoreFilters) = 0;
|
2018-01-04 20:33:29 +01:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Render the CoverageMapping object for specified source files.
|
2018-09-12 23:59:38 +02:00
|
|
|
virtual void renderRoot(ArrayRef<std::string> SourceFiles) = 0;
|
2018-01-04 20:33:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_COV_COVERAGEEXPORTER_H
|