LLVM
22.0.0git
include
llvm
Remarks
RemarkFormat.h
Go to the documentation of this file.
1
//===-- llvm/Remarks/RemarkFormat.h - The format of remarks -----*- 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 defines utilities to deal with the format of remarks.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_REMARKS_REMARKFORMAT_H
14
#define LLVM_REMARKS_REMARKFORMAT_H
15
16
#include "
llvm/ADT/StringRef.h
"
17
#include "
llvm/Support/Compiler.h
"
18
#include "
llvm/Support/Error.h
"
19
20
namespace
llvm
{
21
namespace
remarks
{
22
23
constexpr
StringLiteral
Magic
(
"REMARKS"
);
24
25
/// The format used for serializing/deserializing remarks.
26
enum class
Format
{
Unknown
,
Auto
,
YAML
,
Bitstream
};
27
28
/// Parse and validate a string for the remark format.
29
LLVM_ABI
Expected<Format>
parseFormat
(
StringRef
FormatStr);
30
31
/// Parse and validate a magic number to a remark format.
32
LLVM_ABI
Expected<Format>
magicToFormat
(
StringRef
Magic
);
33
34
/// Detect format based on selected format and magic number
35
LLVM_ABI
Expected<Format>
detectFormat
(
Format
Selected,
StringRef
Magic
);
36
37
}
// end namespace remarks
38
}
// end namespace llvm
39
40
#endif
// LLVM_REMARKS_REMARKFORMAT_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
StringRef.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition
Error.h:485
llvm::StringLiteral
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition
StringRef.h:864
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition
StringRef.h:55
Error.h
llvm::remarks
Definition
AsmPrinter.h:86
llvm::remarks::magicToFormat
LLVM_ABI Expected< Format > magicToFormat(StringRef Magic)
Parse and validate a magic number to a remark format.
Definition
RemarkFormat.cpp:34
llvm::remarks::Magic
constexpr StringLiteral Magic("REMARKS")
llvm::remarks::parseFormat
LLVM_ABI Expected< Format > parseFormat(StringRef FormatStr)
Parse and validate a string for the remark format.
Definition
RemarkFormat.cpp:20
llvm::remarks::Format
Format
The format used for serializing/deserializing remarks.
Definition
RemarkFormat.h:26
llvm::remarks::Format::Auto
@ Auto
Definition
RemarkFormat.h:26
llvm::remarks::Format::Bitstream
@ Bitstream
Definition
RemarkFormat.h:26
llvm::remarks::Format::YAML
@ YAML
Definition
RemarkFormat.h:26
llvm::remarks::detectFormat
LLVM_ABI Expected< Format > detectFormat(Format Selected, StringRef Magic)
Detect format based on selected format and magic number.
Definition
RemarkFormat.cpp:51
llvm::remarks::Type::Unknown
@ Unknown
Definition
Remark.h:76
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
Types.h:26
llvm::ReplacementType::Format
@ Format
Definition
FormatVariadic.h:46
Generated on
for LLVM by
1.14.0