LLVM  14.0.0git
LogBuilderConsumer.cpp
Go to the documentation of this file.
1 //===- FDRRecordConsumer.h - XRay Flight Data Recorder Mode Records -------===//
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 //===----------------------------------------------------------------------===//
9 
10 namespace llvm {
11 namespace xray {
12 
13 Error LogBuilderConsumer::consume(std::unique_ptr<Record> R) {
14  if (!R)
15  return createStringError(
16  std::make_error_code(std::errc::invalid_argument),
17  "Must not call RecordConsumer::consume() with a null pointer.");
18  Records.push_back(std::move(R));
19  return Error::success();
20 }
21 
22 Error PipelineConsumer::consume(std::unique_ptr<Record> R) {
23  if (!R)
24  return createStringError(
25  std::make_error_code(std::errc::invalid_argument),
26  "Must not call RecordConsumer::consume() with a null pointer.");
27 
28  // We apply all of the visitors in order, and concatenate errors
29  // appropriately.
30  Error Result = Error::success();
31  for (auto *V : Visitors)
32  Result = joinErrors(std::move(Result), R->apply(*V));
33  return Result;
34 }
35 
36 } // namespace xray
37 } // namespace llvm
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
FDRRecordConsumer.h
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::joinErrors
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Definition: Error.h:428
llvm::xray::PipelineConsumer::consume
Error consume(std::unique_ptr< Record > R) override
Definition: LogBuilderConsumer.cpp:22
llvm::make_error_code
std::error_code make_error_code(BitcodeError E)
Definition: BitcodeReader.h:270
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1231
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::xray::LogBuilderConsumer::consume
Error consume(std::unique_ptr< Record > R) override
Definition: LogBuilderConsumer.cpp:13