Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //== llvm/Support/CodeGenCoverage.h ------------------------------*- C++ -*-==// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 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 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// \file This file provides rule coverage tracking for tablegen-erated CodeGen. |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H |
| 12 | #define LLVM_SUPPORT_CODEGENCOVERAGE_H |
| 13 | |
| 14 | #include "llvm/ADT/BitVector.h" |
| 15 | |
| 16 | namespace llvm { |
| 17 | class LLVMContext; |
| 18 | class MemoryBuffer; |
| 19 | |
| 20 | class CodeGenCoverage { |
| 21 | protected: |
| 22 | BitVector RuleCoverage; |
| 23 | |
| 24 | public: |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 25 | using const_covered_iterator = BitVector::const_set_bits_iterator; |
| 26 | |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 27 | CodeGenCoverage(); |
| 28 | |
| 29 | void setCovered(uint64_t RuleID); |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 30 | bool isCovered(uint64_t RuleID) const; |
| 31 | iterator_range<const_covered_iterator> covered() const; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 32 | |
| 33 | bool parse(MemoryBuffer &Buffer, StringRef BackendName); |
| 34 | bool emit(StringRef FilePrefix, StringRef BackendName) const; |
| 35 | void reset(); |
| 36 | }; |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 37 | } // namespace llvm |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 38 | |
| 39 | #endif // ifndef LLVM_SUPPORT_CODEGENCOVERAGE_H |