xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-cov/CoverageExporterJson.h (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
1 //===- CoverageExporterJson.h - Code coverage JSON exporter ---------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This class implements a code coverage exporter for JSON format.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_COV_COVERAGEEXPORTERJSON_H
14 #define LLVM_COV_COVERAGEEXPORTERJSON_H
15 
16 #include "CoverageExporter.h"
17 
18 namespace llvm {
19 
20 class CoverageExporterJson : public CoverageExporter {
21 public:
22   CoverageExporterJson(const coverage::CoverageMapping &CoverageMapping,
23                        const CoverageViewOptions &Options, raw_ostream &OS)
24       : CoverageExporter(CoverageMapping, Options, OS) {}
25 
26   /// Render the CoverageMapping object.
27   void renderRoot(const CoverageFilters &IgnoreFilters) override;
28 
29   /// Render the CoverageMapping object for specified source files.
30   void renderRoot(ArrayRef<std::string> SourceFiles) override;
31 };
32 
33 } // end namespace llvm
34 
35 #endif // LLVM_COV_COVERAGEEXPORTERJSON_H
36