DebugSubsection.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/BinaryStreamWriter.h"
  17. #include "llvm/Support/Casting.h"
  18. namespace llvm {
  19. namespace codeview {
  20. class DebugSubsectionRef {
  21. public:
  22. explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {}
  23. virtual ~DebugSubsectionRef();
  24. static bool classof(const DebugSubsectionRef *S) { return true; }
  25. DebugSubsectionKind kind() const { return Kind; }
  26. protected:
  27. DebugSubsectionKind Kind;
  28. };
  29. class DebugSubsection {
  30. public:
  31. explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {}
  32. virtual ~DebugSubsection();
  33. static bool classof(const DebugSubsection *S) { return true; }
  34. DebugSubsectionKind kind() const { return Kind; }
  35. virtual Error commit(BinaryStreamWriter &Writer) const = 0;
  36. virtual uint32_t calculateSerializedSize() const = 0;
  37. protected:
  38. DebugSubsectionKind Kind;
  39. };
  40. } // namespace codeview
  41. } // namespace llvm
  42. #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif