@@ -27,14 +27,13 @@ namespace llvm {
2727// / null-terminated strings, integers in various flavors of endianness, etc.
2828// / Can be subclassed to provide reading of custom datatypes, although no
2929// / are overridable.
30- class BinaryStreamReader {
30+ class LLVM_ABI BinaryStreamReader {
3131public:
3232 BinaryStreamReader () = default ;
33- LLVM_ABI explicit BinaryStreamReader (BinaryStreamRef Ref);
34- LLVM_ABI explicit BinaryStreamReader (BinaryStream &Stream);
35- LLVM_ABI explicit BinaryStreamReader (ArrayRef<uint8_t > Data,
36- llvm::endianness Endian);
37- LLVM_ABI explicit BinaryStreamReader (StringRef Data, llvm::endianness Endian);
33+ explicit BinaryStreamReader (BinaryStreamRef Ref);
34+ explicit BinaryStreamReader (BinaryStream &Stream);
35+ explicit BinaryStreamReader (ArrayRef<uint8_t > Data, llvm::endianness Endian);
36+ explicit BinaryStreamReader (StringRef Data, llvm::endianness Endian);
3837
3938 BinaryStreamReader (const BinaryStreamReader &Other) = default ;
4039
@@ -48,7 +47,7 @@ class BinaryStreamReader {
4847 // /
4948 // / \returns a success error code if the data was successfully read, otherwise
5049 // / returns an appropriate error code.
51- LLVM_ABI Error readLongestContiguousChunk (ArrayRef<uint8_t > &Buffer);
50+ Error readLongestContiguousChunk (ArrayRef<uint8_t > &Buffer);
5251
5352 // / Read \p Size bytes from the underlying stream at the current offset and
5453 // / and set \p Buffer to the resulting data slice. Whether a copy occurs
@@ -57,7 +56,7 @@ class BinaryStreamReader {
5756 // /
5857 // / \returns a success error code if the data was successfully read, otherwise
5958 // / returns an appropriate error code.
60- LLVM_ABI Error readBytes (ArrayRef<uint8_t > &Buffer, uint32_t Size);
59+ Error readBytes (ArrayRef<uint8_t > &Buffer, uint32_t Size);
6160
6261 // / Read an integer of the specified endianness into \p Dest and update the
6362 // / stream's offset. The data is always copied from the stream's underlying
@@ -93,44 +92,44 @@ class BinaryStreamReader {
9392 // /
9493 // / \returns a success error code if the data was successfully read, otherwise
9594 // / returns an appropriate error code.
96- LLVM_ABI Error readULEB128 (uint64_t &Dest);
95+ Error readULEB128 (uint64_t &Dest);
9796
9897 // / Read a signed LEB128 encoded value.
9998 // /
10099 // / \returns a success error code if the data was successfully read, otherwise
101100 // / returns an appropriate error code.
102- LLVM_ABI Error readSLEB128 (int64_t &Dest);
101+ Error readSLEB128 (int64_t &Dest);
103102
104103 // / Read a null terminated string from \p Dest. Whether a copy occurs depends
105104 // / on the implementation of the underlying stream. Updates the stream's
106105 // / offset to point after the newly read data.
107106 // /
108107 // / \returns a success error code if the data was successfully read, otherwise
109108 // / returns an appropriate error code.
110- LLVM_ABI Error readCString (StringRef &Dest);
109+ Error readCString (StringRef &Dest);
111110
112111 // / Similar to readCString, however read a null-terminated UTF16 string
113112 // / instead.
114113 // /
115114 // / \returns a success error code if the data was successfully read, otherwise
116115 // / returns an appropriate error code.
117- LLVM_ABI Error readWideString (ArrayRef<UTF16> &Dest);
116+ Error readWideString (ArrayRef<UTF16> &Dest);
118117
119118 // / Read a \p Length byte string into \p Dest. Whether a copy occurs depends
120119 // / on the implementation of the underlying stream. Updates the stream's
121120 // / offset to point after the newly read data.
122121 // /
123122 // / \returns a success error code if the data was successfully read, otherwise
124123 // / returns an appropriate error code.
125- LLVM_ABI Error readFixedString (StringRef &Dest, uint32_t Length);
124+ Error readFixedString (StringRef &Dest, uint32_t Length);
126125
127126 // / Read the entire remainder of the underlying stream into \p Ref. This is
128127 // / equivalent to calling getUnderlyingStream().slice(Offset). Updates the
129128 // / stream's offset to point to the end of the stream. Never causes a copy.
130129 // /
131130 // / \returns a success error code if the data was successfully read, otherwise
132131 // / returns an appropriate error code.
133- LLVM_ABI Error readStreamRef (BinaryStreamRef &Ref);
132+ Error readStreamRef (BinaryStreamRef &Ref);
134133
135134 // / Read \p Length bytes from the underlying stream into \p Ref. This is
136135 // / equivalent to calling getUnderlyingStream().slice(Offset, Length).
@@ -139,7 +138,7 @@ class BinaryStreamReader {
139138 // /
140139 // / \returns a success error code if the data was successfully read, otherwise
141140 // / returns an appropriate error code.
142- LLVM_ABI Error readStreamRef (BinaryStreamRef &Ref, uint32_t Length);
141+ Error readStreamRef (BinaryStreamRef &Ref, uint32_t Length);
143142
144143 // / Read \p Length bytes from the underlying stream into \p Ref. This is
145144 // / equivalent to calling getUnderlyingStream().slice(Offset, Length).
@@ -148,7 +147,7 @@ class BinaryStreamReader {
148147 // /
149148 // / \returns a success error code if the data was successfully read, otherwise
150149 // / returns an appropriate error code.
151- LLVM_ABI Error readSubstream (BinarySubstreamRef &Ref, uint32_t Length);
150+ Error readSubstream (BinarySubstreamRef &Ref, uint32_t Length);
152151
153152 // / Get a pointer to an object of type T from the underlying stream, as if by
154153 // / memcpy, and store the result into \p Dest. It is up to the caller to
@@ -253,17 +252,17 @@ class BinaryStreamReader {
253252 // /
254253 // / \returns a success error code if at least \p Amount bytes remain in the
255254 // / stream, otherwise returns an appropriate error code.
256- LLVM_ABI Error skip (uint64_t Amount);
255+ Error skip (uint64_t Amount);
257256
258257 // / Examine the next byte of the underlying stream without advancing the
259258 // / stream's offset. If the stream is empty the behavior is undefined.
260259 // /
261260 // / \returns the next byte in the stream.
262- LLVM_ABI uint8_t peek () const ;
261+ uint8_t peek () const ;
263262
264- LLVM_ABI Error padToAlignment (uint32_t Align);
263+ Error padToAlignment (uint32_t Align);
265264
266- LLVM_ABI std::pair<BinaryStreamReader, BinaryStreamReader>
265+ std::pair<BinaryStreamReader, BinaryStreamReader>
267266 split (uint64_t Offset) const ;
268267
269268private:
0 commit comments