LLVM  3.7.0
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_COVERAGEMAPPINGWRITER_H
16 #define LLVM_PROFILEDATA_COVERAGEMAPPINGWRITER_H
17 
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringMap.h"
22 
23 namespace llvm {
24 namespace coverage {
25 
26 /// \brief Writer of the filenames section for the instrumentation
27 /// based code coverage.
29  ArrayRef<StringRef> Filenames;
30 
31 public:
33  : Filenames(Filenames) {}
34 
35  /// \brief Write encoded filenames to the given output stream.
36  void write(raw_ostream &OS);
37 };
38 
39 /// \brief Writer for instrumentation based coverage mapping data.
41  ArrayRef<unsigned> VirtualFileMapping;
42  ArrayRef<CounterExpression> Expressions;
44 
45 public:
47  ArrayRef<CounterExpression> Expressions,
49  : VirtualFileMapping(VirtualFileMapping), Expressions(Expressions),
50  MappingRegions(MappingRegions) {}
51 
54  : Expressions(Expressions), MappingRegions(MappingRegions) {}
55 
56  /// \brief Write encoded coverage mapping data to the given output stream.
57  void write(raw_ostream &OS);
58 };
59 
60 } // end namespace coverage
61 } // end namespace llvm
62 
63 #endif
Writer for instrumentation based coverage mapping data.
void write(raw_ostream &OS)
Write encoded coverage mapping data to the given output stream.
CoverageMappingWriter(ArrayRef< CounterExpression > Expressions, MutableArrayRef< CounterMappingRegion > MappingRegions)
void write(raw_ostream &OS)
Write encoded filenames to the given output stream.
CoverageMappingWriter(ArrayRef< unsigned > VirtualFileMapping, ArrayRef< CounterExpression > Expressions, MutableArrayRef< CounterMappingRegion > MappingRegions)
CoverageFilenamesSectionWriter(ArrayRef< StringRef > Filenames)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:31
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:221
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:38