Path: blob/main/contrib/llvm-project/llvm/lib/XRay/LogBuilderConsumer.cpp
35234 views
//===- FDRRecordConsumer.h - XRay Flight Data Recorder Mode Records -------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7#include "llvm/XRay/FDRRecordConsumer.h"89namespace llvm {10namespace xray {1112Error LogBuilderConsumer::consume(std::unique_ptr<Record> R) {13if (!R)14return createStringError(15std::make_error_code(std::errc::invalid_argument),16"Must not call RecordConsumer::consume() with a null pointer.");17Records.push_back(std::move(R));18return Error::success();19}2021Error PipelineConsumer::consume(std::unique_ptr<Record> R) {22if (!R)23return createStringError(24std::make_error_code(std::errc::invalid_argument),25"Must not call RecordConsumer::consume() with a null pointer.");2627// We apply all of the visitors in order, and concatenate errors28// appropriately.29Error Result = Error::success();30for (auto *V : Visitors)31Result = joinErrors(std::move(Result), R->apply(*V));32return Result;33}3435} // namespace xray36} // namespace llvm373839