1 //===-- llvm/Remarks/RemarkFormat.h - The format of remarks -----*- C++/-*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines utilities to deal with the format of remarks.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_REMARKS_REMARK_FORMAT_H
14 #define LLVM_REMARKS_REMARK_FORMAT_H
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/Support/Error.h"
22 constexpr StringLiteral Magic("REMARKS");
24 /// The format used for serializing/deserializing remarks.
25 enum class Format { Unknown, YAML, YAMLStrTab, Bitstream };
27 /// Parse and validate a string for the remark format.
28 Expected<Format> parseFormat(StringRef FormatStr);
30 /// Parse and validate a magic number to a remark format.
31 Expected<Format> magicToFormat(StringRef Magic);
33 } // end namespace remarks
34 } // end namespace llvm
36 #endif /* LLVM_REMARKS_REMARK_FORMAT_H */