blob: 66272870efdacbc559c93f592ab06b0375fcb292 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- DebugSubsection.h ------------------------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENT_H
10#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENT_H
11
12#include "llvm/DebugInfo/CodeView/CodeView.h"
13#include "llvm/Support/BinaryStreamWriter.h"
14#include "llvm/Support/Casting.h"
15
16namespace llvm {
17namespace codeview {
18
19class DebugSubsectionRef {
20public:
21 explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {}
22 virtual ~DebugSubsectionRef();
23
24 static bool classof(const DebugSubsectionRef *S) { return true; }
25
26 DebugSubsectionKind kind() const { return Kind; }
27
28protected:
29 DebugSubsectionKind Kind;
30};
31
32class DebugSubsection {
33public:
34 explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {}
35 virtual ~DebugSubsection();
36
37 static bool classof(const DebugSubsection *S) { return true; }
38
39 DebugSubsectionKind kind() const { return Kind; }
40
41 virtual Error commit(BinaryStreamWriter &Writer) const = 0;
42 virtual uint32_t calculateSerializedSize() const = 0;
43
44protected:
45 DebugSubsectionKind Kind;
46};
47
48} // namespace codeview
49} // namespace llvm
50
51#endif // LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENT_H