DebugSubsection.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //===- DebugSubsection.h ------------------------------------*- 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. #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  9. #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  10. #include "llvm/DebugInfo/CodeView/CodeView.h"
  11. #include "llvm/Support/BinaryStreamWriter.h"
  12. #include "llvm/Support/Casting.h"
  13. namespace llvm {
  14. namespace codeview {
  15. class DebugSubsectionRef {
  16. public:
  17. explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {}
  18. virtual ~DebugSubsectionRef();
  19. static bool classof(const DebugSubsectionRef *S) { return true; }
  20. DebugSubsectionKind kind() const { return Kind; }
  21. protected:
  22. DebugSubsectionKind Kind;
  23. };
  24. class DebugSubsection {
  25. public:
  26. explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {}
  27. virtual ~DebugSubsection();
  28. static bool classof(const DebugSubsection *S) { return true; }
  29. DebugSubsectionKind kind() const { return Kind; }
  30. virtual Error commit(BinaryStreamWriter &Writer) const = 0;
  31. virtual uint32_t calculateSerializedSize() const = 0;
  32. protected:
  33. DebugSubsectionKind Kind;
  34. };
  35. } // namespace codeview
  36. } // namespace llvm
  37. #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H