Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:39

0001 //===- DebugFrameDataSubsection.h ------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
0011 
0012 #include "llvm/DebugInfo/CodeView/CodeView.h"
0013 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
0014 #include "llvm/Support/BinaryStreamArray.h"
0015 #include "llvm/Support/BinaryStreamRef.h"
0016 #include "llvm/Support/Endian.h"
0017 #include "llvm/Support/Error.h"
0018 
0019 namespace llvm {
0020 class BinaryStreamReader;
0021 class BinaryStreamWriter;
0022 
0023 namespace codeview {
0024 class DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
0025 public:
0026   DebugFrameDataSubsectionRef()
0027       : DebugSubsectionRef(DebugSubsectionKind::FrameData) {}
0028   static bool classof(const DebugSubsection *S) {
0029     return S->kind() == DebugSubsectionKind::FrameData;
0030   }
0031 
0032   Error initialize(BinaryStreamReader Reader);
0033   Error initialize(BinaryStreamRef Stream);
0034 
0035   FixedStreamArray<FrameData>::Iterator begin() const { return Frames.begin(); }
0036   FixedStreamArray<FrameData>::Iterator end() const { return Frames.end(); }
0037 
0038   const support::ulittle32_t *getRelocPtr() const { return RelocPtr; }
0039 
0040 private:
0041   const support::ulittle32_t *RelocPtr = nullptr;
0042   FixedStreamArray<FrameData> Frames;
0043 };
0044 
0045 class DebugFrameDataSubsection final : public DebugSubsection {
0046 public:
0047   DebugFrameDataSubsection(bool IncludeRelocPtr)
0048       : DebugSubsection(DebugSubsectionKind::FrameData),
0049         IncludeRelocPtr(IncludeRelocPtr) {}
0050   static bool classof(const DebugSubsection *S) {
0051     return S->kind() == DebugSubsectionKind::FrameData;
0052   }
0053 
0054   uint32_t calculateSerializedSize() const override;
0055   Error commit(BinaryStreamWriter &Writer) const override;
0056 
0057   void addFrameData(const FrameData &Frame);
0058   void setFrames(ArrayRef<FrameData> Frames);
0059 
0060 private:
0061   bool IncludeRelocPtr = false;
0062   std::vector<FrameData> Frames;
0063 };
0064 }
0065 }
0066 
0067 #endif