LLVM 20.0.0git
BlockPrinter.h
Go to the documentation of this file.
1//===- BlockPrinter.h - FDR Block Pretty Printer -------------------------===//
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 formats a block of records for
10// easier human consumption.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_XRAY_BLOCKPRINTER_H
14#define LLVM_XRAY_BLOCKPRINTER_H
15
19
20namespace llvm {
21namespace xray {
22
24 enum class State {
25 Start,
26 Preamble,
29 Arg,
30 CustomEvent,
31 End,
32 };
33
34 raw_ostream &OS;
35 RecordPrinter &RP;
36 State CurrentState = State::Start;
37
38public:
39 explicit BlockPrinter(raw_ostream &O, RecordPrinter &P) : OS(O), RP(P) {}
40
41 Error visit(BufferExtents &) override;
42 Error visit(WallclockRecord &) override;
43 Error visit(NewCPUIDRecord &) override;
44 Error visit(TSCWrapRecord &) override;
45 Error visit(CustomEventRecord &) override;
46 Error visit(CallArgRecord &) override;
47 Error visit(PIDRecord &) override;
48 Error visit(NewBufferRecord &) override;
49 Error visit(EndBufferRecord &) override;
50 Error visit(FunctionRecord &) override;
52 Error visit(TypedEventRecord &) override;
53
54 void reset() { CurrentState = State::Start; }
55};
56
57} // namespace xray
58} // namespace llvm
59
60#endif // LLVM_XRAY_BLOCKPRINTER_H
bool End
Definition: ELF_riscv.cpp:480
#define P(N)
raw_pwrite_stream & OS
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Root of the metadata hierarchy.
Definition: Metadata.h:62
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
Error visit(BufferExtents &) override
BlockPrinter(raw_ostream &O, RecordPrinter &P)
Definition: BlockPrinter.h:39
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18