LLVM 22.0.0git
YAMLRemarkSerializer.h
Go to the documentation of this file.
1//===-- YAMLRemarkSerializer.h - YAML Remark serialization ---*- C++ -*-===//
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//===----------------------------------------------------------------------===//
8//
9// This file provides an interface for serializing remarks to YAML.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_REMARKS_YAMLREMARKSERIALIZER_H
14#define LLVM_REMARKS_YAMLREMARKSERIALIZER_H
15
19
20namespace llvm {
21namespace remarks {
22
23/// Serialize the remarks to YAML. One remark entry looks like this:
24/// --- !<TYPE>
25/// Pass: <PASSNAME>
26/// Name: <REMARKNAME>
27/// DebugLoc: { File: <SOURCEFILENAME>, Line: <SOURCELINE>,
28/// Column: <SOURCECOLUMN> }
29/// Function: <FUNCTIONNAME>
30/// Args:
31/// - <KEY>: <VALUE>
32/// DebugLoc: { File: <FILE>, Line: <LINE>, Column: <COL> }
33/// ...
35 /// The YAML streamer.
37
40
41 void emit(const Remark &Remark) override;
42 std::unique_ptr<MetaSerializer>
43 metaSerializer(raw_ostream &OS, StringRef ExternalFilename) override;
44
45 static bool classof(const RemarkSerializer *S) {
46 return S->SerializerFormat == Format::YAML;
47 }
48};
49
58
59} // end namespace remarks
60} // end namespace llvm
61
62#endif // LLVM_REMARKS_YAMLREMARKSERIALIZER_H
#define LLVM_ABI
Definition Compiler.h:213
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
The Output class is used to generate a yaml document from in-memory structs and vectors.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & OS
The open raw_ostream that the metadata is emitted to.
Format SerializerFormat
The format of the serializer.
RemarkSerializer(Format SerializerFormat, raw_ostream &OS)
raw_ostream & OS
The open raw_ostream that the remark diagnostics are emitted to.
A remark type used for both emission and parsing.
Definition Remark.h:107
The string table used for serializing remarks.
YAMLMetaSerializer(raw_ostream &OS, StringRef ExternalFilename)
static bool classof(const RemarkSerializer *S)
void emit(const Remark &Remark) override
Emit a remark to the stream.
yaml::Output YAMLOutput
The YAML streamer.
std::unique_ptr< MetaSerializer > metaSerializer(raw_ostream &OS, StringRef ExternalFilename) override
Return the corresponding metadata serializer.