LLVM  14.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 
17 #include "llvm/XRay/FDRRecords.h"
19 
20 namespace llvm {
21 namespace xray {
22 
23 class BlockPrinter : public RecordVisitor {
24  enum class State {
25  Start,
26  Preamble,
27  Metadata,
28  Function,
29  Arg,
30  CustomEvent,
31  End,
32  };
33 
34  raw_ostream &OS;
35  RecordPrinter &RP;
36  State CurrentState = State::Start;
37 
38 public:
40  : RecordVisitor(), OS(O), RP(P) {}
41 
42  Error visit(BufferExtents &) override;
43  Error visit(WallclockRecord &) override;
44  Error visit(NewCPUIDRecord &) override;
45  Error visit(TSCWrapRecord &) override;
46  Error visit(CustomEventRecord &) override;
47  Error visit(CallArgRecord &) override;
48  Error visit(PIDRecord &) override;
49  Error visit(NewBufferRecord &) override;
50  Error visit(EndBufferRecord &) override;
51  Error visit(FunctionRecord &) override;
52  Error visit(CustomEventRecordV5 &) override;
53  Error visit(TypedEventRecord &) override;
54 
55  void reset() { CurrentState = State::Start; }
56 };
57 
58 } // namespace xray
59 } // namespace llvm
60 
61 #endif // LLVM_XRAY_BLOCKPRINTER_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::xray::RecordVisitor
Definition: FDRRecords.h:399
llvm::xray::BlockPrinter::BlockPrinter
BlockPrinter(raw_ostream &O, RecordPrinter &P)
Definition: BlockPrinter.h:39
llvm::Function
Definition: Function.h:62
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::xray::FunctionRecord
Definition: FDRRecords.h:372
llvm::xray::PIDRecord
Definition: FDRRecords.h:313
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:206
llvm::xray::BufferExtents
Definition: FDRRecords.h:110
llvm::xray::NewCPUIDRecord
Definition: FDRRecords.h:158
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::xray::BlockPrinter::reset
void reset()
Definition: BlockPrinter.h:55
llvm::xray::NewBufferRecord
Definition: FDRRecords.h:336
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::xray::BlockPrinter::visit
Error visit(BufferExtents &) override
Definition: BlockPrinter.cpp:13
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:197
llvm::xray::EndBufferRecord
Definition: FDRRecords.h:359
llvm::xray::WallclockRecord
Definition: FDRRecords.h:133
llvm::xray::CallArgRecord
Definition: FDRRecords.h:291
llvm::xray::TypedEventRecord
Definition: FDRRecords.h:262
llvm::xray::BlockPrinter
Definition: BlockPrinter.h:23
llvm::xray::TSCWrapRecord
Definition: FDRRecords.h:184
RecordPrinter.h
llvm::xray::RecordPrinter
Definition: RecordPrinter.h:22
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::xray::CustomEventRecord
Definition: FDRRecords.h:206
llvm::xray::CustomEventRecordV5
Definition: FDRRecords.h:235
raw_ostream.h
FDRRecords.h