DebugSubsection.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- DebugSubsection.h ------------------------------------*- 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. #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  14. #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  15. #include "llvm/DebugInfo/CodeView/CodeView.h"
  16. #include "llvm/Support/Error.h"
  17. #include <cstdint>
  18. namespace llvm {
  19. class BinaryStreamWriter;
  20. namespace codeview {
  21. class DebugSubsectionRef {
  22. public:
  23. explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {}
  24. virtual ~DebugSubsectionRef();
  25. static bool classof(const DebugSubsectionRef *S) { return true; }
  26. DebugSubsectionKind kind() const { return Kind; }
  27. protected:
  28. DebugSubsectionKind Kind;
  29. };
  30. class DebugSubsection {
  31. public:
  32. explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {}
  33. virtual ~DebugSubsection();
  34. static bool classof(const DebugSubsection *S) { return true; }
  35. DebugSubsectionKind kind() const { return Kind; }
  36. virtual Error commit(BinaryStreamWriter &Writer) const = 0;
  37. virtual uint32_t calculateSerializedSize() const = 0;
  38. protected:
  39. DebugSubsectionKind Kind;
  40. };
  41. } // namespace codeview
  42. } // namespace llvm
  43. #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif