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

1

2

3

4

5

6

7

8

9

10

11

12

20

21using namespace llvm;

24

25

26

28 return StringRef(reinterpret_cast<const char *>(LeafData.data()),

29 LeafData.size());

30}

31

34}

35

37

38 bool FalseVal = false;

41 return EC;

42

43 if (Short < LF_NUMERIC) {

44 Num = APSInt(APInt(16, Short, false),

45 true);

47 }

48

49 switch (Short) {

50 case LF_CHAR: {

51 int8_t N;

53 return EC;

56 }

57 case LF_SHORT: {

58 int16_t N;

60 return EC;

63 }

64 case LF_USHORT: {

67 return EC;

70 }

71 case LF_LONG: {

72 int32_t N;

74 return EC;

77 }

78 case LF_ULONG: {

81 return EC;

84 }

85 case LF_QUADWORD: {

86 int64_t N;

88 return EC;

91 }

92 case LF_UQUADWORD: {

95 return EC;

98 }

99 }

100 return make_error(cv_error_code::corrupt_record,

101 "Buffer contains invalid APSInt type");

102}

103

110 return EC;

111}

112

113

118 return EC;

119 if (N.isSigned() || N.isIntN(64))

120 return make_error(cv_error_code::corrupt_record,

121 "Data is not a numeric value!");

122 Num = N.getLimitedValue();

124}

125

128}

129

136 return EC;

137}

138

141}

142

144 if (Reader.empty())

145 return make_error(cv_error_code::corrupt_record,

146 "Null terminated string buffer is empty!");

147

149}

150

153 return readCVRecordFromStream(Stream, Offset);

154}

This file implements a class to represent arbitrary precision integral constant values and operations...

This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...

Class for arbitrary precision integers.

An arbitrary precision integer that knows its signedness.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

size_t size() const

size - Get the array size.

An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.

Provides read only access to a subclass of BinaryStream.

Error readCString(StringRef &Dest)

Read a null terminated string from Dest.

Error readInteger(T &Dest)

Read an integer of the specified endianness into Dest and update the stream's offset.

uint64_t bytesRemaining() const

BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

Tagged union holding either a T or a Error.

StringRef - Represent a constant reference to a string, i.e.

std::pair< StringRef, StringRef > split(char Separator) const

Split into two substrings around the first occurrence of a separator character.

Error consume_numeric(BinaryStreamReader &Reader, uint64_t &Value)

Decodes a numeric leaf value that is known to be a particular type.

Error consume(BinaryStreamReader &Reader)

StringRef getBytesAsCString(ArrayRef< uint8_t > LeafData)

StringRef getBytesAsCharacters(ArrayRef< uint8_t > LeafData)

Reinterpret a byte array as an array of characters.

Expected< CVSymbol > readSymbolFromStream(BinaryStreamRef Stream, uint32_t Offset)

This is an optimization pass for GlobalISel generic memory operations.