[llvm] r366842 - [Remarks][NFC] Move the YAML serializer to its own header
Francis Visoiu Mistrih via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 12:28:03 PDT 2019
Author: thegameg
Date: Tue Jul 23 12:28:03 2019
New Revision: 366842
URL: http://llvm.org/viewvc/llvm-project?rev=366842&view=rev
Log:
[Remarks][NFC] Move the YAML serializer to its own header
Added:
llvm/trunk/include/llvm/Remarks/YAMLRemarkSerializer.h
Modified:
llvm/trunk/include/llvm/Remarks/RemarkSerializer.h
llvm/trunk/lib/IR/RemarkStreamer.cpp
llvm/trunk/lib/Remarks/YAMLRemarkSerializer.cpp
llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cpp
Modified: llvm/trunk/include/llvm/Remarks/RemarkSerializer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Remarks/RemarkSerializer.h?rev=366842&r1=366841&r2=366842&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Remarks/RemarkSerializer.h (original)
+++ llvm/trunk/include/llvm/Remarks/RemarkSerializer.h Tue Jul 23 12:28:03 2019
@@ -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:
-/// --- !<TYPE>
-/// Pass: <PASSNAME>
-/// Name: <REMARKNAME>
-/// DebugLoc: { File: <SOURCEFILENAME>, Line: <SOURCELINE>,
-/// Column: <SOURCECOLUMN> }
-/// Function: <FUNCTIONNAME>
-/// Args:
-/// - <KEY>: <VALUE>
-/// DebugLoc: { File: <FILE>, Line: <LINE>, Column: <COL> }
-/// ...
-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
Added: llvm/trunk/include/llvm/Remarks/YAMLRemarkSerializer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Remarks/YAMLRemarkSerializer.h?rev=366842&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Remarks/YAMLRemarkSerializer.h (added)
+++ llvm/trunk/include/llvm/Remarks/YAMLRemarkSerializer.h Tue Jul 23 12:28:03 2019
@@ -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:
+/// --- !<TYPE>
+/// Pass: <PASSNAME>
+/// Name: <REMARKNAME>
+/// DebugLoc: { File: <SOURCEFILENAME>, Line: <SOURCELINE>,
+/// Column: <SOURCECOLUMN> }
+/// Function: <FUNCTIONNAME>
+/// Args:
+/// - <KEY>: <VALUE>
+/// DebugLoc: { File: <FILE>, Line: <LINE>, Column: <COL> }
+/// ...
+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 */
Modified: llvm/trunk/lib/IR/RemarkStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/RemarkStreamer.cpp?rev=366842&r1=366841&r2=366842&view=diff
==============================================================================
--- llvm/trunk/lib/IR/RemarkStreamer.cpp (original)
+++ llvm/trunk/lib/IR/RemarkStreamer.cpp Tue Jul 23 12:28:03 2019
@@ -16,6 +16,7 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Remarks/RemarkFormat.h"
+#include "llvm/Remarks/YAMLRemarkSerializer.h"
using namespace llvm;
Modified: llvm/trunk/lib/Remarks/YAMLRemarkSerializer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Remarks/YAMLRemarkSerializer.cpp?rev=366842&r1=366841&r2=366842&view=diff
==============================================================================
--- llvm/trunk/lib/Remarks/YAMLRemarkSerializer.cpp (original)
+++ llvm/trunk/lib/Remarks/YAMLRemarkSerializer.cpp Tue Jul 23 12:28:03 2019
@@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Remarks/RemarkSerializer.h"
+#include "llvm/Remarks/YAMLRemarkSerializer.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
Modified: llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cpp?rev=366842&r1=366841&r2=366842&view=diff
==============================================================================
--- llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cpp (original)
+++ llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cpp Tue Jul 23 12:28:03 2019
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Remarks/Remark.h"
-#include "llvm/Remarks/RemarkSerializer.h"
+#include "llvm/Remarks/YAMLRemarkSerializer.h"
#include "gtest/gtest.h"
using namespace llvm;
More information about the llvm-commits
mailing list