[PowerPC] Keep vector int to fp conversions in vector domain
[llvm-core.git] / include / llvm / XRay / FDRRecordConsumer.h
blobe856e1540558e903da993e1ff97ccd1c12fcd08f
1 //===- FDRRecordConsumer.h - XRay Flight Data Recorder Mode Records -------===//
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 #ifndef LLVM_INCLUDE_LLVM_XRAY_FDRRECORDCONSUMER_H_
10 #define LLVM_INCLUDE_LLVM_XRAY_FDRRECORDCONSUMER_H_
12 #include "llvm/Support/Error.h"
13 #include "llvm/XRay/FDRRecords.h"
14 #include <algorithm>
15 #include <memory>
16 #include <vector>
18 namespace llvm {
19 namespace xray {
21 class RecordConsumer {
22 public:
23 virtual Error consume(std::unique_ptr<Record> R) = 0;
24 virtual ~RecordConsumer() = default;
27 // This consumer will collect all the records into a vector of records, in
28 // arrival order.
29 class LogBuilderConsumer : public RecordConsumer {
30 std::vector<std::unique_ptr<Record>> &Records;
32 public:
33 explicit LogBuilderConsumer(std::vector<std::unique_ptr<Record>> &R)
34 : RecordConsumer(), Records(R) {}
36 Error consume(std::unique_ptr<Record> R) override;
39 // A PipelineConsumer applies a set of visitors to every consumed Record, in the
40 // order by which the visitors are added to the pipeline in the order of
41 // appearance.
42 class PipelineConsumer : public RecordConsumer {
43 std::vector<RecordVisitor *> Visitors;
45 public:
46 PipelineConsumer(std::initializer_list<RecordVisitor *> V)
47 : RecordConsumer(), Visitors(V) {}
49 Error consume(std::unique_ptr<Record> R) override;
52 } // namespace xray
53 } // namespace llvm
55 #endif // LLVM_INCLUDE_LLVM_XRAY_FDRRECORDCONSUMER_H_