LLVM  8.0.1
CoverageMappingWriter.h
Go to the documentation of this file.
1 //===- CoverageMappingWriter.h - Code coverage mapping writer ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for writing coverage mapping data for
11 // instrumentation based coverage.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
16 #define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
17 
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
21 
22 namespace llvm {
23 
24 class raw_ostream;
25 
26 namespace coverage {
27 
28 /// Writer of the filenames section for the instrumentation
29 /// based code coverage.
31  ArrayRef<StringRef> Filenames;
32 
33 public:
35  : Filenames(Filenames) {}
36 
37  /// Write encoded filenames to the given output stream.
38  void write(raw_ostream &OS);
39 };
40 
41 /// Writer for instrumentation based coverage mapping data.
43  ArrayRef<unsigned> VirtualFileMapping;
46 
47 public:
49  ArrayRef<CounterExpression> Expressions,
51  : VirtualFileMapping(VirtualFileMapping), Expressions(Expressions),
52  MappingRegions(MappingRegions) {}
53 
54  /// Write encoded coverage mapping data to the given output stream.
55  void write(raw_ostream &OS);
56 };
57 
58 } // end namespace coverage
59 
60 } // end namespace llvm
61 
62 #endif // LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
Writer for instrumentation based coverage mapping data.
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void write(raw_ostream &OS)
Write encoded filenames to the given output stream.
CoverageMappingWriter(ArrayRef< unsigned > VirtualFileMapping, ArrayRef< CounterExpression > Expressions, MutableArrayRef< CounterMappingRegion > MappingRegions)
gvn Early GVN Hoisting of Expressions
Definition: GVNHoist.cpp:1204
CoverageFilenamesSectionWriter(ArrayRef< StringRef > Filenames)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:291
Writer of the filenames section for the instrumentation based code coverage.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46