LLVM: lib/DebugInfo/CodeView/DebugSubsectionRecord.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

16#include

17#include

18

19using namespace llvm;

21

23

26 : Kind(Kind), Data(Data) {}

27

33 return EC;

34

37 if (auto EC = Reader.readStreamRef(Info.Data, Header->Length))

38 return EC;

39 Info.Kind = Kind;

41}

42

46

48

50

52 std::shared_ptr Subsection)

53 : Subsection(std::move(Subsection)) {}

54

57 : Contents(Contents) {}

58

60 uint32_t DataSize = Subsection ? Subsection->calculateSerializedSize()

61 : Contents.getRecordData().getLength();

62

63

65}

66

70 "Debug Subsection not properly aligned");

71

73 Header.Kind = uint32_t(Subsection ? Subsection->kind() : Contents.kind());

74

75

76 uint32_t DataSize = Subsection ? Subsection->calculateSerializedSize()

77 : Contents.getRecordData().getLength();

79

81 return EC;

82 if (Subsection) {

83 if (auto EC = Subsection->commit(Writer))

84 return EC;

85 } else {

86 if (auto EC = Writer.writeStreamRef(Contents.getRecordData()))

87 return EC;

88 }

90 return EC;

91

93}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

Provides read only access to a subclass of BinaryStream.

LLVM_ABI Error readStreamRef(BinaryStreamRef &Ref)

Read the entire remainder of the underlying stream into Ref.

Error readObject(const T *&Dest)

Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...

BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.

Provides write only access to a subclass of WritableBinaryStream.

uint64_t getOffset() const

LLVM_ABI Error writeStreamRef(BinaryStreamRef Ref)

Efficiently reads all data from Ref, and writes it to this stream.

Error writeObject(const T &Obj)

Writes the object Obj to the underlying stream, as if by using memcpy.

LLVM_ABI Error padToAlignment(uint32_t Align)

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

LLVM_ABI Error commit(BinaryStreamWriter &Writer, CodeViewContainer Container) const

Definition DebugSubsectionRecord.cpp:67

LLVM_ABI uint32_t calculateSerializedLength() const

Definition DebugSubsectionRecord.cpp:59

LLVM_ABI DebugSubsectionRecordBuilder(std::shared_ptr< DebugSubsection > Subsection)

Definition DebugSubsectionRecord.cpp:51

LLVM_ABI BinaryStreamRef getRecordData() const

Definition DebugSubsectionRecord.cpp:49

LLVM_ABI DebugSubsectionKind kind() const

Definition DebugSubsectionRecord.cpp:47

static LLVM_ABI Error initialize(BinaryStreamRef Stream, DebugSubsectionRecord &Info)

Definition DebugSubsectionRecord.cpp:28

LLVM_ABI DebugSubsectionRecord()

LLVM_ABI uint32_t getRecordLength() const

Definition DebugSubsectionRecord.cpp:43

uint32_t alignOf(CodeViewContainer Container)

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr uintptr_t uintptr_t DataSize

uint64_t alignTo(uint64_t Size, Align A)

Returns a multiple of A needed to store Size bytes.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.