LLVM 22.0.0git
RecordPrinter.h
Go to the documentation of this file.
1//===- RecordPrinter.h - FDR Record 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 prints an individual record's
10// data in an adhoc format, suitable for human inspection.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_XRAY_RECORDPRINTER_H
14#define LLVM_XRAY_RECORDPRINTER_H
15
19
20namespace llvm {
21namespace xray {
22
24 raw_ostream &OS;
25 std::string Delim;
26
27public:
28 explicit RecordPrinter(raw_ostream &O, std::string D)
29 : OS(O), Delim(std::move(D)) {}
30
31 explicit RecordPrinter(raw_ostream &O) : RecordPrinter(O, ""){};
32
33 Error visit(BufferExtents &) override;
34 Error visit(WallclockRecord &) override;
35 Error visit(NewCPUIDRecord &) override;
36 Error visit(TSCWrapRecord &) override;
37 Error visit(CustomEventRecord &) override;
38 Error visit(CallArgRecord &) override;
39 Error visit(PIDRecord &) override;
40 Error visit(NewBufferRecord &) override;
41 Error visit(EndBufferRecord &) override;
42 Error visit(FunctionRecord &) override;
44 Error visit(TypedEventRecord &) override;
45};
46
47} // namespace xray
48} // namespace llvm
49
50#endif // LLVM_XRAY_RECORDPRINTER_H
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define LLVM_ABI
Definition Compiler.h:213
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 class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
RecordPrinter(raw_ostream &O)
RecordPrinter(raw_ostream &O, std::string D)
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1847
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:870