From cbbdc4183837dfea92cf840b93e0f12e2bcccffc Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Tue, 23 Jul 2019 19:28:03 +0000 Subject: [Remarks][NFC] Move the YAML serializer to its own header llvm-svn: 366842 --- llvm/include/llvm/Remarks/RemarkSerializer.h | 23 ------------ llvm/include/llvm/Remarks/YAMLRemarkSerializer.h | 47 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 llvm/include/llvm/Remarks/YAMLRemarkSerializer.h (limited to 'llvm/include') diff --git a/llvm/include/llvm/Remarks/RemarkSerializer.h b/llvm/include/llvm/Remarks/RemarkSerializer.h index def5c2e1662..3eddac41cb0 100644 --- a/llvm/include/llvm/Remarks/RemarkSerializer.h +++ b/llvm/include/llvm/Remarks/RemarkSerializer.h @@ -15,7 +15,6 @@ #include "llvm/Remarks/Remark.h" #include "llvm/Remarks/RemarkStringTable.h" -#include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" namespace llvm { @@ -40,28 +39,6 @@ struct Serializer { /// Wether the serializer should use a string table while emitting. enum class UseStringTable { No, Yes }; -/// Serialize the remarks to YAML. One remark entry looks like this: -/// --- ! -/// Pass: -/// Name: -/// DebugLoc: { File: , Line: , -/// Column: } -/// Function: -/// Args: -/// - : -/// DebugLoc: { File: , Line: , Column: } -/// ... -struct YAMLSerializer : public Serializer { - /// The YAML streamer. - yaml::Output YAMLOutput; - - YAMLSerializer(raw_ostream &OS, - UseStringTable UseStringTable = remarks::UseStringTable::No); - - /// Emit a remark to the stream. - void emit(const Remark &Remark) override; -}; - } // end namespace remarks } // end namespace llvm diff --git a/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h new file mode 100644 index 00000000000..5b817321ce9 --- /dev/null +++ b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h @@ -0,0 +1,47 @@ +//===-- YAMLRemarkSerializer.h - YAML Remark serialization ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file provides an interface for serializing remarks to YAML. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_REMARKS_YAML_REMARK_SERIALIZER_H +#define LLVM_REMARKS_YAML_REMARK_SERIALIZER_H + +#include "llvm/Remarks/RemarkSerializer.h" +#include "llvm/Support/YAMLTraits.h" + +namespace llvm { +namespace remarks { + +/// Serialize the remarks to YAML. One remark entry looks like this: +/// --- ! +/// Pass: +/// Name: +/// DebugLoc: { File: , Line: , +/// Column: } +/// Function: +/// Args: +/// - : +/// DebugLoc: { File: , Line: , Column: } +/// ... +struct YAMLSerializer : public Serializer { + /// The YAML streamer. + yaml::Output YAMLOutput; + + YAMLSerializer(raw_ostream &OS, + UseStringTable UseStringTable = remarks::UseStringTable::No); + + /// Emit a remark to the stream. + void emit(const Remark &Remark) override; +}; + +} // end namespace remarks +} // end namespace llvm + +#endif /* LLVM_REMARKS_REMARK_SERIALIZER_H */ -- cgit v1.2.3