RemarkFormat.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/Remarks/RemarkFormat.h - The format of remarks -----*- C++/-*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines utilities to deal with the format of remarks.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_REMARKS_REMARKFORMAT_H
  18. #define LLVM_REMARKS_REMARKFORMAT_H
  19. #include "llvm/ADT/StringRef.h"
  20. #include "llvm/Support/Error.h"
  21. namespace llvm {
  22. namespace remarks {
  23. constexpr StringLiteral Magic("REMARKS");
  24. /// The format used for serializing/deserializing remarks.
  25. enum class Format { Unknown, YAML, YAMLStrTab, Bitstream };
  26. /// Parse and validate a string for the remark format.
  27. Expected<Format> parseFormat(StringRef FormatStr);
  28. /// Parse and validate a magic number to a remark format.
  29. Expected<Format> magicToFormat(StringRef Magic);
  30. } // end namespace remarks
  31. } // end namespace llvm
  32. #endif // LLVM_REMARKS_REMARKFORMAT_H
  33. #ifdef __GNUC__
  34. #pragma GCC diagnostic pop
  35. #endif