LLVM  16.0.0git
DebugFrameDataSubsection.h
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
10 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
11 
16 #include "llvm/Support/Endian.h"
17 #include "llvm/Support/Error.h"
18 
19 namespace llvm {
20 class BinaryStreamReader;
21 class BinaryStreamWriter;
22 
23 namespace codeview {
25 public:
28  static bool classof(const DebugSubsection *S) {
29  return S->kind() == DebugSubsectionKind::FrameData;
30  }
31 
34 
35  FixedStreamArray<FrameData>::Iterator begin() const { return Frames.begin(); }
36  FixedStreamArray<FrameData>::Iterator end() const { return Frames.end(); }
37 
38  const support::ulittle32_t *getRelocPtr() const { return RelocPtr; }
39 
40 private:
41  const support::ulittle32_t *RelocPtr = nullptr;
43 };
44 
46 public:
47  DebugFrameDataSubsection(bool IncludeRelocPtr)
49  IncludeRelocPtr(IncludeRelocPtr) {}
50  static bool classof(const DebugSubsection *S) {
51  return S->kind() == DebugSubsectionKind::FrameData;
52  }
53 
54  uint32_t calculateSerializedSize() const override;
55  Error commit(BinaryStreamWriter &Writer) const override;
56 
57  void addFrameData(const FrameData &Frame);
58  void setFrames(ArrayRef<FrameData> Frames);
59 
60 private:
61  bool IncludeRelocPtr = false;
62  std::vector<FrameData> Frames;
63 };
64 }
65 }
66 
67 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::support::detail::packed_endian_specific_integral
Definition: Endian.h:206
llvm::codeview::DebugFrameDataSubsectionRef::end
FixedStreamArray< FrameData >::Iterator end() const
Definition: DebugFrameDataSubsection.h:36
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:30
llvm::codeview::DebugFrameDataSubsectionRef
Definition: DebugFrameDataSubsection.h:24
Error.h
llvm::codeview::DebugFrameDataSubsectionRef::classof
static bool classof(const DebugSubsection *S)
Definition: DebugFrameDataSubsection.h:28
llvm::codeview::DebugFrameDataSubsectionRef::getRelocPtr
const support::ulittle32_t * getRelocPtr() const
Definition: DebugFrameDataSubsection.h:38
llvm::codeview::FrameData
Data in the SUBSEC_FRAMEDATA subection.
Definition: CodeView.h:577
llvm::codeview::DebugFrameDataSubsection::DebugFrameDataSubsection
DebugFrameDataSubsection(bool IncludeRelocPtr)
Definition: DebugFrameDataSubsection.h:47
llvm::FixedStreamArray
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
Definition: BinaryStreamArray.h:259
llvm::codeview::DebugFrameDataSubsectionRef::begin
FixedStreamArray< FrameData >::Iterator begin() const
Definition: DebugFrameDataSubsection.h:35
llvm::codeview::DebugFrameDataSubsection::commit
Error commit(BinaryStreamWriter &Writer) const override
Definition: DebugFrameDataSubsection.cpp:45
llvm::codeview::DebugSubsectionRef
Definition: DebugSubsection.h:21
CodeView.h
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
DebugSubsection.h
BinaryStreamArray.h
llvm::codeview::DebugFrameDataSubsection::setFrames
void setFrames(ArrayRef< FrameData > Frames)
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::codeview::DebugFrameDataSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugFrameDataSubsection.cpp:17
BinaryStreamRef.h
llvm::codeview::DebugFrameDataSubsection::calculateSerializedSize
uint32_t calculateSerializedSize() const override
Definition: DebugFrameDataSubsection.cpp:38
uint32_t
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::codeview::DebugSubsection
Definition: DebugSubsection.h:34
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::codeview::DebugFrameDataSubsection
Definition: DebugFrameDataSubsection.h:45
llvm::codeview::DebugFrameDataSubsection::classof
static bool classof(const DebugSubsection *S)
Definition: DebugFrameDataSubsection.h:50
llvm::codeview::DebugFrameDataSubsection::addFrameData
void addFrameData(const FrameData &Frame)
Definition: DebugFrameDataSubsection.cpp:60
llvm::codeview::DebugSubsectionKind
DebugSubsectionKind
Definition: CodeView.h:315
Endian.h
llvm::FixedStreamArrayIterator
Definition: BinaryStreamArray.h:252
llvm::codeview::DebugSubsectionKind::FrameData
@ FrameData
llvm::BinaryStreamRef
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Definition: BinaryStreamRef.h:155
llvm::codeview::DebugFrameDataSubsectionRef::DebugFrameDataSubsectionRef
DebugFrameDataSubsectionRef()
Definition: DebugFrameDataSubsection.h:26