LLVM
15.0.0git
include
llvm
XRay
FDRLogBuilder.h
Go to the documentation of this file.
1
//===- FDRLogBuilder.h - XRay FDR Log Building Utility --------------------===//
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
#ifndef LLVM_XRAY_FDRLOGBUILDER_H
9
#define LLVM_XRAY_FDRLOGBUILDER_H
10
11
#include "
llvm/XRay/FDRRecords.h
"
12
13
namespace
llvm
{
14
namespace
xray {
15
16
/// The LogBuilder class allows for creating ad-hoc collections of records
17
/// through the `add<...>(...)` function. An example use of this API is in
18
/// crafting arbitrary sequences of records:
19
///
20
/// auto Records = LogBuilder()
21
/// .add<BufferExtents>(256)
22
/// .add<NewBufferRecord>(1)
23
/// .consume();
24
///
25
class
LogBuilder
{
26
std::vector<std::unique_ptr<Record>> Records;
27
28
public
:
29
template
<
class
R,
class
...
T
>
LogBuilder
&
add
(T &&... A) {
30
Records.emplace_back(
new
R(std::forward<T>(A)...));
31
return
*
this
;
32
}
33
34
std::vector<std::unique_ptr<Record>>
consume
() {
return
std::move
(Records); }
35
};
36
37
}
// namespace xray
38
}
// namespace llvm
39
40
#endif // LLVM_XRAY_FDRLOGBUILDER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:17
llvm::xray::LogBuilder::consume
std::vector< std::unique_ptr< Record > > consume()
Definition:
FDRLogBuilder.h:34
T
#define T
Definition:
Mips16ISelLowering.cpp:341
llvm::xray::LogBuilder
The LogBuilder class allows for creating ad-hoc collections of records through the add<....
Definition:
FDRLogBuilder.h:25
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition:
README.txt:546
llvm::xray::LogBuilder::add
LogBuilder & add(T &&... A)
Definition:
FDRLogBuilder.h:29
FDRRecords.h
Generated on Wed Jul 20 2022 15:43:56 for LLVM by
1.8.17