LLVM 22.0.0git
BlockVerifier.h
Go to the documentation of this file.
1//===- BlockVerifier.h - FDR Block Verifier -------------------------------===//
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// An implementation of the RecordVisitor which verifies a sequence of records
10// associated with a block, following the FDR mode log format's specifications.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_XRAY_BLOCKVERIFIER_H
14#define LLVM_XRAY_BLOCKVERIFIER_H
15
18
19namespace llvm {
20namespace xray {
21
23public:
24 // We force State elements to be size_t, to be used as indices for containers.
40
41private:
42 // We keep track of the current record seen by the verifier.
43 State CurrentRecord = State::Unknown;
44
45 // Transitions the current record to the new record, records an error on
46 // invalid transitions.
47 Error transition(State To);
48
49public:
50 Error visit(BufferExtents &) override;
51 Error visit(WallclockRecord &) override;
52 Error visit(NewCPUIDRecord &) override;
53 Error visit(TSCWrapRecord &) override;
54 Error visit(CustomEventRecord &) override;
55 Error visit(CallArgRecord &) override;
56 Error visit(PIDRecord &) override;
57 Error visit(NewBufferRecord &) override;
58 Error visit(EndBufferRecord &) override;
59 Error visit(FunctionRecord &) override;
61 Error visit(TypedEventRecord &) override;
62
63 Error verify();
64 void reset();
65};
66
67} // namespace xray
68} // namespace llvm
69
70#endif // LLVM_XRAY_BLOCKVERIFIER_H
#define LLVM_ABI
Definition Compiler.h:213
ppc ctr loops verify
void visit(MachineFunction &MF, MachineBasicBlock &Start, std::function< void(MachineBasicBlock *)> op)
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
This is an optimization pass for GlobalISel generic memory operations.