LLVM
20.0.0git
include
llvm
XRay
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
16
#include "
llvm/XRay/FDRRecords.h
"
17
18
namespace
llvm
{
19
namespace
xray {
20
21
class
BlockVerifier
:
public
RecordVisitor
{
22
public
:
23
// We force State elements to be size_t, to be used as indices for containers.
24
enum class
State
: std::size_t {
25
Unknown
,
26
BufferExtents
,
27
NewBuffer
,
28
WallClockTime
,
29
PIDEntry
,
30
NewCPUId
,
31
TSCWrap
,
32
CustomEvent
,
33
TypedEvent
,
34
Function
,
35
CallArg
,
36
EndOfBuffer
,
37
StateMax
,
38
};
39
40
private
:
41
// We keep track of the current record seen by the verifier.
42
State
CurrentRecord =
State::Unknown
;
43
44
// Transitions the current record to the new record, records an error on
45
// invalid transitions.
46
Error
transition(
State
To);
47
48
public
:
49
Error
visit
(
BufferExtents
&)
override
;
50
Error
visit
(
WallclockRecord
&)
override
;
51
Error
visit
(
NewCPUIDRecord
&)
override
;
52
Error
visit
(
TSCWrapRecord
&)
override
;
53
Error
visit
(
CustomEventRecord
&)
override
;
54
Error
visit
(
CallArgRecord
&)
override
;
55
Error
visit
(
PIDRecord
&)
override
;
56
Error
visit
(
NewBufferRecord
&)
override
;
57
Error
visit
(
EndBufferRecord
&)
override
;
58
Error
visit
(
FunctionRecord
&)
override
;
59
Error
visit
(
CustomEventRecordV5
&)
override
;
60
Error
visit
(
TypedEventRecord
&)
override
;
61
62
Error
verify
();
63
void
reset
();
64
};
65
66
}
// namespace xray
67
}
// namespace llvm
68
69
#endif
// LLVM_XRAY_BLOCKVERIFIER_H
FDRRecords.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:
Error.h:160
llvm::xray::BlockVerifier
Definition:
BlockVerifier.h:21
llvm::xray::BlockVerifier::visit
Error visit(BufferExtents &) override
Definition:
BlockVerifier.cpp:138
llvm::xray::BlockVerifier::verify
Error verify()
Definition:
BlockVerifier.cpp:184
llvm::xray::BlockVerifier::State
State
Definition:
BlockVerifier.h:24
llvm::xray::BlockVerifier::State::WallClockTime
@ WallClockTime
llvm::xray::BlockVerifier::State::CallArg
@ CallArg
llvm::xray::BlockVerifier::State::NewCPUId
@ NewCPUId
llvm::xray::BlockVerifier::State::TypedEvent
@ TypedEvent
llvm::xray::BlockVerifier::State::TSCWrap
@ TSCWrap
llvm::xray::BlockVerifier::State::Function
@ Function
llvm::xray::BlockVerifier::State::Unknown
@ Unknown
llvm::xray::BlockVerifier::State::NewBuffer
@ NewBuffer
llvm::xray::BlockVerifier::State::StateMax
@ StateMax
llvm::xray::BlockVerifier::State::PIDEntry
@ PIDEntry
llvm::xray::BlockVerifier::State::CustomEvent
@ CustomEvent
llvm::xray::BlockVerifier::State::BufferExtents
@ BufferExtents
llvm::xray::BlockVerifier::State::EndOfBuffer
@ EndOfBuffer
llvm::xray::BlockVerifier::reset
void reset()
Definition:
BlockVerifier.cpp:203
llvm::xray::BufferExtents
Definition:
FDRRecords.h:110
llvm::xray::CallArgRecord
Definition:
FDRRecords.h:291
llvm::xray::CustomEventRecordV5
Definition:
FDRRecords.h:235
llvm::xray::CustomEventRecord
Definition:
FDRRecords.h:206
llvm::xray::EndBufferRecord
Definition:
FDRRecords.h:359
llvm::xray::FunctionRecord
Definition:
FDRRecords.h:372
llvm::xray::NewBufferRecord
Definition:
FDRRecords.h:336
llvm::xray::NewCPUIDRecord
Definition:
FDRRecords.h:158
llvm::xray::PIDRecord
Definition:
FDRRecords.h:313
llvm::xray::RecordVisitor
Definition:
FDRRecords.h:399
llvm::xray::TSCWrapRecord
Definition:
FDRRecords.h:184
llvm::xray::TypedEventRecord
Definition:
FDRRecords.h:262
llvm::xray::WallclockRecord
Definition:
FDRRecords.h:133
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
Generated on Fri Dec 20 2024 01:40:47 for LLVM by
1.9.6