[InstCombine] Signed saturation patterns
[llvm-core.git] / include / llvm / DebugInfo / CodeView / DebugFrameDataSubsection.h
blobd5cd640231f99ff0945b12ff2d56ffd70540a42d
1 //===- DebugFrameDataSubsection.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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
10 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
12 #include "llvm/DebugInfo/CodeView/CodeView.h"
13 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
14 #include "llvm/Support/BinaryStreamReader.h"
15 #include "llvm/Support/Endian.h"
16 #include "llvm/Support/Error.h"
18 namespace llvm {
19 namespace codeview {
20 class DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
21 public:
22 DebugFrameDataSubsectionRef()
23 : DebugSubsectionRef(DebugSubsectionKind::FrameData) {}
24 static bool classof(const DebugSubsection *S) {
25 return S->kind() == DebugSubsectionKind::FrameData;
28 Error initialize(BinaryStreamReader Reader);
29 Error initialize(BinaryStreamRef Stream);
31 FixedStreamArray<FrameData>::Iterator begin() const { return Frames.begin(); }
32 FixedStreamArray<FrameData>::Iterator end() const { return Frames.end(); }
34 const support::ulittle32_t *getRelocPtr() const { return RelocPtr; }
36 private:
37 const support::ulittle32_t *RelocPtr = nullptr;
38 FixedStreamArray<FrameData> Frames;
41 class DebugFrameDataSubsection final : public DebugSubsection {
42 public:
43 DebugFrameDataSubsection(bool IncludeRelocPtr)
44 : DebugSubsection(DebugSubsectionKind::FrameData),
45 IncludeRelocPtr(IncludeRelocPtr) {}
46 static bool classof(const DebugSubsection *S) {
47 return S->kind() == DebugSubsectionKind::FrameData;
50 uint32_t calculateSerializedSize() const override;
51 Error commit(BinaryStreamWriter &Writer) const override;
53 void addFrameData(const FrameData &Frame);
54 void setFrames(ArrayRef<FrameData> Frames);
56 private:
57 bool IncludeRelocPtr = false;
58 std::vector<FrameData> Frames;
63 #endif