blob: d5bd837bff2894c7333653a207d41cba412f61e6 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//== llvm/Support/CodeGenCoverage.h ------------------------------*- 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/// \file This file provides rule coverage tracking for tablegen-erated CodeGen.
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H
13#define LLVM_SUPPORT_CODEGENCOVERAGE_H
14
15#include "llvm/ADT/BitVector.h"
16
17namespace llvm {
18class LLVMContext;
19class MemoryBuffer;
20
21class CodeGenCoverage {
22protected:
23 BitVector RuleCoverage;
24
25public:
26 CodeGenCoverage();
27
28 void setCovered(uint64_t RuleID);
29 bool isCovered(uint64_t RuleID);
30
31 bool parse(MemoryBuffer &Buffer, StringRef BackendName);
32 bool emit(StringRef FilePrefix, StringRef BackendName) const;
33 void reset();
34};
35} // end namespace llvm
36
37#endif // ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H