1 //== llvm/Support/CodeGenCoverage.h ------------------------------*- C++ -*-==//
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
7 //===----------------------------------------------------------------------===//
8 /// \file This file provides rule coverage tracking for tablegen-erated CodeGen.
9 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H
12 #define LLVM_SUPPORT_CODEGENCOVERAGE_H
14 #include "llvm/ADT/BitVector.h"
20 class CodeGenCoverage
{
22 BitVector RuleCoverage
;
25 using const_covered_iterator
= BitVector::const_set_bits_iterator
;
29 void setCovered(uint64_t RuleID
);
30 bool isCovered(uint64_t RuleID
) const;
31 iterator_range
<const_covered_iterator
> covered() const;
33 bool parse(MemoryBuffer
&Buffer
, StringRef BackendName
);
34 bool emit(StringRef FilePrefix
, StringRef BackendName
) const;
39 #endif // ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H