LLVM
8.0.1
include
llvm
XRay
BlockVerifier.h
Go to the documentation of this file.
1
//===- BlockVerifier.h - FDR Block Verifier -------------------------------===//
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
//
10
// An implementation of the RecordVisitor which verifies a sequence of records
11
// associated with a block, following the FDR mode log format's specifications.
12
//
13
//===----------------------------------------------------------------------===//
14
#ifndef LLVM_INCLUDE_LLVM_XRAY_BLOCKVERIFIER_H_
15
#define LLVM_INCLUDE_LLVM_XRAY_BLOCKVERIFIER_H_
16
17
#include "
llvm/XRay/FDRRecords.h
"
18
#include <array>
19
#include <bitset>
20
21
namespace
llvm
{
22
namespace
xray {
23
24
class
BlockVerifier
:
public
RecordVisitor
{
25
public
:
26
// We force State elements to be size_t, to be used as indices for containers.
27
enum class
State
: std::size_t {
28
Unknown
,
29
BufferExtents
,
30
NewBuffer
,
31
WallClockTime
,
32
PIDEntry
,
33
NewCPUId
,
34
TSCWrap
,
35
CustomEvent
,
36
TypedEvent
,
37
Function
,
38
CallArg
,
39
EndOfBuffer
,
40
StateMax
,
41
};
42
43
private
:
44
// We keep track of the current record seen by the verifier.
45
State
CurrentRecord =
State::Unknown
;
46
47
// Transitions the current record to the new record, records an error on
48
// invalid transitions.
49
Error
transition(
State
To);
50
51
public
:
52
Error
visit
(
BufferExtents
&)
override
;
53
Error
visit
(
WallclockRecord
&)
override
;
54
Error
visit
(
NewCPUIDRecord
&)
override
;
55
Error
visit
(
TSCWrapRecord
&)
override
;
56
Error
visit
(
CustomEventRecord
&)
override
;
57
Error
visit
(
CallArgRecord
&)
override
;
58
Error
visit
(
PIDRecord
&)
override
;
59
Error
visit
(
NewBufferRecord
&)
override
;
60
Error
visit
(
EndBufferRecord
&)
override
;
61
Error
visit
(
FunctionRecord
&)
override
;
62
Error
visit
(
CustomEventRecordV5
&)
override
;
63
Error
visit
(
TypedEventRecord
&)
override
;
64
65
Error
verify
();
66
void
reset
();
67
};
68
69
}
// namespace xray
70
}
// namespace llvm
71
72
#endif // LLVM_INCLUDE_LLVM_XRAY_BLOCKVERIFIER_H_
llvm::xray::NewCPUIDRecord
Definition:
FDRRecords.h:159
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::xray::TypedEventRecord
Definition:
FDRRecords.h:263
llvm::xray::BlockVerifier::State::BufferExtents
llvm::xray::FunctionRecord
Definition:
FDRRecords.h:373
llvm::xray::CustomEventRecord
Definition:
FDRRecords.h:207
llvm::xray::BlockVerifier::State::StateMax
llvm::xray::WallclockRecord
Definition:
FDRRecords.h:134
llvm::xray::BlockVerifier::State::NewBuffer
llvm::xray::BlockVerifier
Definition:
BlockVerifier.h:24
FDRRecords.h
llvm::xray::BlockVerifier::State
State
Definition:
BlockVerifier.h:27
llvm::xray::BlockVerifier::reset
void reset()
Definition:
BlockVerifier.cpp:202
llvm::xray::BlockVerifier::State::TypedEvent
llvm::xray::BlockVerifier::verify
Error verify()
Definition:
BlockVerifier.cpp:183
llvm::xray::BlockVerifier::State::EndOfBuffer
llvm::xray::NewBufferRecord
Definition:
FDRRecords.h:337
llvm::xray::BlockVerifier::State::CallArg
llvm::xray::RecordVisitor
Definition:
FDRRecords.h:400
llvm::xray::BufferExtents
Definition:
FDRRecords.h:111
llvm::xray::BlockVerifier::visit
Error visit(BufferExtents &) override
Definition:
BlockVerifier.cpp:137
llvm::xray::CallArgRecord
Definition:
FDRRecords.h:292
llvm::xray::EndBufferRecord
Definition:
FDRRecords.h:360
llvm::xray::BlockVerifier::State::Unknown
llvm::xray::CustomEventRecordV5
Definition:
FDRRecords.h:236
llvm::xray::PIDRecord
Definition:
FDRRecords.h:314
llvm::xray::BlockVerifier::State::Function
llvm::xray::TSCWrapRecord
Definition:
FDRRecords.h:185
llvm::xray::BlockVerifier::State::TSCWrap
llvm::xray::BlockVerifier::State::PIDEntry
llvm::xray::BlockVerifier::State::CustomEvent
llvm::xray::BlockVerifier::State::WallClockTime
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:
Error.h:158
llvm::xray::BlockVerifier::State::NewCPUId
Generated on Sun Dec 20 2020 13:53:40 for LLVM by
1.8.13