1 //== llvm/Support/CodeGenCoverage.h ------------------------------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 /// \file This file provides rule coverage tracking for tablegen-erated CodeGen.
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H
13 #define LLVM_SUPPORT_CODEGENCOVERAGE_H
15 #include "llvm/ADT/BitVector.h"
21 class CodeGenCoverage {
23 BitVector RuleCoverage;
26 using const_covered_iterator = BitVector::const_set_bits_iterator;
30 void setCovered(uint64_t RuleID);
31 bool isCovered(uint64_t RuleID) const;
32 iterator_range<const_covered_iterator> covered() const;
34 bool parse(MemoryBuffer &Buffer, StringRef BackendName);
35 bool emit(StringRef FilePrefix, StringRef BackendName) const;
40 #endif // ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H