LLVM  14.0.0git
CoverageMappingWriter.h
Go to the documentation of this file.
1 //===- CoverageMappingWriter.h - Code coverage mapping writer ---*- C++ -*-===//
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 file contains support for writing coverage mapping data for
10 // instrumentation based coverage.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
15 #define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/StringRef.h"
20 
21 namespace llvm {
22 
23 class raw_ostream;
24 
25 namespace coverage {
26 
27 /// Writer of the filenames section for the instrumentation
28 /// based code coverage.
30  ArrayRef<std::string> Filenames;
31 
32 public:
34 
35  /// Write encoded filenames to the given output stream. If \p Compress is
36  /// true, attempt to compress the filenames.
37  void write(raw_ostream &OS, bool Compress = true);
38 };
39 
40 /// Writer for instrumentation based coverage mapping data.
42  ArrayRef<unsigned> VirtualFileMapping;
43  ArrayRef<CounterExpression> Expressions;
45 
46 public:
48  ArrayRef<CounterExpression> Expressions,
50  : VirtualFileMapping(VirtualFileMapping), Expressions(Expressions),
51  MappingRegions(MappingRegions) {}
52 
53  /// Write encoded coverage mapping data to the given output stream.
54  void write(raw_ostream &OS);
55 };
56 
57 } // end namespace coverage
58 
59 } // end namespace llvm
60 
61 #endif // LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
StringRef.h
llvm::coverage::CoverageFilenamesSectionWriter
Writer of the filenames section for the instrumentation based code coverage.
Definition: CoverageMappingWriter.h:29
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:305
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::coverage::CoverageFilenamesSectionWriter::write
void write(raw_ostream &OS, bool Compress=true)
Write encoded filenames to the given output stream.
Definition: CoverageMappingWriter.cpp:39
llvm::coverage::CoverageMappingWriter::write
void write(raw_ostream &OS)
Write encoded coverage mapping data to the given output stream.
Definition: CoverageMappingWriter.cpp:155
ArrayRef.h
llvm::coverage::CoverageMappingWriter::CoverageMappingWriter
CoverageMappingWriter(ArrayRef< unsigned > VirtualFileMapping, ArrayRef< CounterExpression > Expressions, MutableArrayRef< CounterMappingRegion > MappingRegions)
Definition: CoverageMappingWriter.h:47
llvm::ArrayRef< std::string >
CoverageMapping.h
Expressions
gvn Early GVN Hoisting of Expressions
Definition: GVNHoist.cpp:1261
llvm::coverage::CoverageMappingWriter
Writer for instrumentation based coverage mapping data.
Definition: CoverageMappingWriter.h:41
llvm::coverage::CoverageFilenamesSectionWriter::CoverageFilenamesSectionWriter
CoverageFilenamesSectionWriter(ArrayRef< std::string > Filenames)
Definition: CoverageMappingWriter.cpp:29