LLVM 22.0.0git
BitstreamRemarkContainer.h
Go to the documentation of this file.
1//===-- BitstreamRemarkContainer.h - Container for remarks --------------*-===//
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 declarations for things used in the various types of
10// remark containers.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_REMARKS_BITSTREAMREMARKCONTAINER_H
15#define LLVM_REMARKS_BITSTREAMREMARKCONTAINER_H
16
17#include "llvm/ADT/StringRef.h"
19#include <cstdint>
20
21namespace llvm {
22namespace remarks {
23
24/// The current version of the remark container.
25/// Note: this is different from the version of the remark entry.
27/// The magic number used for identifying remark blocks.
28constexpr StringLiteral ContainerMagic("RMRK");
29
30/// Type of the remark container.
32 /// Emit a link to an external remarks file
33 /// (usually as a section of the object file, to enable discovery of all
34 /// remarks files from the final linked object file)
35 /// RemarksFileExternal:
36 /// | Meta:
37 /// | | Container info
38 /// | | External file
40 /// Emit metadata and remarks into a file
41 /// RemarksFile:
42 /// | Meta:
43 /// | | Container info
44 /// | | Remark version
45 /// | Remarks:
46 /// | | Remark0
47 /// | | Remark1
48 /// | | Remark2
49 /// | | ...
50 /// | Late Meta:
51 /// | | String table
55};
56
57/// The possible blocks that will be encountered in a bitstream remark
58/// container.
60 /// The metadata block is mandatory. It should always come after the
61 /// BLOCKINFO_BLOCK, and contains metadata that should be used when parsing
62 /// REMARK_BLOCKs.
63 /// There should always be only one META_BLOCK.
65 /// One remark entry is represented using a REMARK_BLOCK. There can be
66 /// multiple REMARK_BLOCKs in the same file.
68};
69
70constexpr StringLiteral MetaBlockName("Meta");
71constexpr StringLiteral RemarkBlockName("Remark");
72
73/// The possible records that can be encountered in the previously described
74/// blocks.
91
92constexpr StringLiteral MetaContainerInfoName("Container info");
93constexpr StringLiteral MetaRemarkVersionName("Remark version");
94constexpr StringLiteral MetaStrTabName("String table");
95constexpr StringLiteral MetaExternalFileName("External File");
96constexpr StringLiteral RemarkHeaderName("Remark header");
97constexpr StringLiteral RemarkDebugLocName("Remark debug location");
98constexpr StringLiteral RemarkHotnessName("Remark hotness");
99constexpr StringLiteral
100 RemarkArgWithDebugLocName("Argument with debug location");
102
103} // end namespace remarks
104} // end namespace llvm
105
106#endif // LLVM_REMARKS_BITSTREAMREMARKCONTAINER_H
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition StringRef.h:854
@ FIRST_APPLICATION_BLOCKID
constexpr StringLiteral RemarkDebugLocName("Remark debug location")
BitstreamRemarkContainerType
Type of the remark container.
@ RemarksFileExternal
Emit a link to an external remarks file (usually as a section of the object file, to enable discovery...
@ RemarksFile
Emit metadata and remarks into a file RemarksFile: | Meta: | | Container info | | Remark version | Re...
constexpr StringLiteral RemarkArgWithDebugLocName("Argument with debug location")
BlockIDs
The possible blocks that will be encountered in a bitstream remark container.
@ REMARK_BLOCK_ID
One remark entry is represented using a REMARK_BLOCK.
@ META_BLOCK_ID
The metadata block is mandatory.
constexpr uint64_t CurrentContainerVersion
The current version of the remark container.
constexpr StringLiteral MetaExternalFileName("External File")
constexpr StringLiteral MetaRemarkVersionName("Remark version")
constexpr StringLiteral MetaContainerInfoName("Container info")
constexpr StringLiteral RemarkHeaderName("Remark header")
constexpr StringLiteral MetaBlockName("Meta")
constexpr StringLiteral RemarkArgWithoutDebugLocName("Argument")
constexpr StringLiteral RemarkBlockName("Remark")
constexpr StringLiteral ContainerMagic("RMRK")
The magic number used for identifying remark blocks.
constexpr StringLiteral MetaStrTabName("String table")
RecordIDs
The possible records that can be encountered in the previously described blocks.
constexpr StringLiteral RemarkHotnessName("Remark hotness")
This is an optimization pass for GlobalISel generic memory operations.