Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / include / llvm / ProfileData / Coverage / CoverageMappingWriter.h
blob5f88cacdfcbb1f31dab6fb8a925764d975412c52
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
15 #define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
21 namespace llvm {
23 class raw_ostream;
25 namespace coverage {
27 /// Writer of the filenames section for the instrumentation
28 /// based code coverage.
29 class CoverageFilenamesSectionWriter {
30 ArrayRef<StringRef> Filenames;
32 public:
33 CoverageFilenamesSectionWriter(ArrayRef<StringRef> Filenames)
34 : Filenames(Filenames) {}
36 /// Write encoded filenames to the given output stream.
37 void write(raw_ostream &OS);
40 /// Writer for instrumentation based coverage mapping data.
41 class CoverageMappingWriter {
42 ArrayRef<unsigned> VirtualFileMapping;
43 ArrayRef<CounterExpression> Expressions;
44 MutableArrayRef<CounterMappingRegion> MappingRegions;
46 public:
47 CoverageMappingWriter(ArrayRef<unsigned> VirtualFileMapping,
48 ArrayRef<CounterExpression> Expressions,
49 MutableArrayRef<CounterMappingRegion> MappingRegions)
50 : VirtualFileMapping(VirtualFileMapping), Expressions(Expressions),
51 MappingRegions(MappingRegions) {}
53 /// Write encoded coverage mapping data to the given output stream.
54 void write(raw_ostream &OS);
57 } // end namespace coverage
59 } // end namespace llvm
61 #endif // LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H