Skip to content

Commit 38f4db7

Browse files
committed
[llvm] IDS auto-annotation of llvm/Support library interface
1 parent db42345 commit 38f4db7

File tree

122 files changed

+1098
-992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+1098
-992
lines changed

llvm/include/llvm/Support/AArch64AttributeParser.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
#ifndef LLVM_SUPPORT_AARCH64ATTRIBUTEPARSER_H
1010
#define LLVM_SUPPORT_AARCH64ATTRIBUTEPARSER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/Support/ELFAttrParserExtended.h"
1314
#include "llvm/Support/ELFAttributes.h"
1415

1516
namespace llvm {
1617

1718
class AArch64AttributeParser : public ELFExtendedAttrParser {
18-
static std::vector<SubsectionAndTagToTagName> &returnTagsNamesMap();
19+
LLVM_ABI static std::vector<SubsectionAndTagToTagName> &returnTagsNamesMap();
1920

2021
public:
2122
AArch64AttributeParser(ScopedPrinter *Sw)

llvm/include/llvm/Support/AMDGPUMetadata.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_SUPPORT_AMDGPUMETADATA_H
1616
#define LLVM_SUPPORT_AMDGPUMETADATA_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/ADT/StringRef.h"
1920
#include <cstdint>
2021
#include <string>
@@ -447,10 +448,10 @@ struct Metadata final {
447448
};
448449

449450
/// Converts \p String to \p HSAMetadata.
450-
std::error_code fromString(StringRef String, Metadata &HSAMetadata);
451+
LLVM_ABI std::error_code fromString(StringRef String, Metadata &HSAMetadata);
451452

452453
/// Converts \p HSAMetadata to \p String.
453-
std::error_code toString(Metadata HSAMetadata, std::string &String);
454+
LLVM_ABI std::error_code toString(Metadata HSAMetadata, std::string &String);
454455

455456
//===----------------------------------------------------------------------===//
456457
// HSA metadata for v3 code object.

llvm/include/llvm/Support/ARMAttributeParser.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_SUPPORT_ARMATTRIBUTEPARSER_H
1010
#define LLVM_SUPPORT_ARMATTRIBUTEPARSER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "ARMBuildAttributes.h"
1314
#include "llvm/ADT/StringRef.h"
1415
#include "llvm/Support/ELFAttrParserCompact.h"
@@ -18,7 +19,7 @@ namespace llvm {
1819

1920
class ScopedPrinter;
2021

21-
class ARMAttributeParser : public ELFCompactAttrParser {
22+
class LLVM_ABI ARMAttributeParser : public ELFCompactAttrParser {
2223
struct DisplayHandler {
2324
ARMBuildAttrs::AttrType attribute;
2425
Error (ARMAttributeParser::*routine)(ARMBuildAttrs::AttrType);

llvm/include/llvm/Support/ARMBuildAttributes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
#ifndef LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
1919
#define LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
2020

21+
#include "llvm/Support/Compiler.h"
2122
#include "llvm/Support/ELFAttributes.h"
2223

2324
namespace llvm {
2425
namespace ARMBuildAttrs {
2526

26-
const TagNameMap &getARMAttributeTags();
27+
LLVM_ABI const TagNameMap &getARMAttributeTags();
2728

2829
enum SpecialAttr {
2930
// This is for the .cpu asm attr. It translates into one or more

llvm/include/llvm/Support/ARMWinEH.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_SUPPORT_ARMWINEH_H
1010
#define LLVM_SUPPORT_ARMWINEH_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/Support/Endian.h"
1415

@@ -205,7 +206,7 @@ inline uint16_t StackAdjustment(const RuntimeFunction &RF) {
205206

206207
/// SavedRegisterMask - Utility function to calculate the set of saved general
207208
/// purpose (r0-r15) and VFP (d0-d31) registers.
208-
std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
209+
LLVM_ABI std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
209210
bool Prologue = true);
210211

211212
/// RuntimeFunctionARM64 - An entry in the table of procedure data (.pdata)

llvm/include/llvm/Support/Allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace detail {
3636

3737
// We call out to an external function to actually print the message as the
3838
// printing code uses Allocator.h in its implementation.
39-
void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
39+
LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
4040
size_t TotalMemory);
4141

4242
} // end namespace detail

llvm/include/llvm/Support/BalancedPartitioning.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#ifndef LLVM_SUPPORT_BALANCED_PARTITIONING_H
4040
#define LLVM_SUPPORT_BALANCED_PARTITIONING_H
4141

42+
#include "llvm/Support/Compiler.h"
4243
#include "raw_ostream.h"
4344
#include "llvm/ADT/ArrayRef.h"
4445

@@ -67,7 +68,7 @@ class BPFunctionNode {
6768
/// The ID of this node
6869
IDT Id;
6970

70-
void dump(raw_ostream &OS) const;
71+
LLVM_ABI void dump(raw_ostream &OS) const;
7172

7273
protected:
7374
/// The list of utility nodes associated with this node
@@ -99,10 +100,10 @@ struct BalancedPartitioningConfig {
99100

100101
class BalancedPartitioning {
101102
public:
102-
BalancedPartitioning(const BalancedPartitioningConfig &Config);
103+
LLVM_ABI BalancedPartitioning(const BalancedPartitioningConfig &Config);
103104

104105
/// Run recursive graph partitioning that optimizes a given objective.
105-
void run(std::vector<BPFunctionNode> &Nodes) const;
106+
LLVM_ABI void run(std::vector<BPFunctionNode> &Nodes) const;
106107

107108
private:
108109
struct UtilitySignature;
@@ -127,7 +128,7 @@ class BalancedPartitioning {
127128
/// Blocking wait for all threads to complete. Unlike ThreadPool, it is
128129
/// acceptable for other threads to add more tasks while blocking on this
129130
/// call.
130-
void wait();
131+
LLVM_ABI void wait();
131132
BPThreadPool(ThreadPoolInterface &TheThreadPool)
132133
: TheThreadPool(TheThreadPool) {}
133134
};
@@ -192,7 +193,7 @@ class BalancedPartitioning {
192193

193194
protected:
194195
/// Compute the move gain for uniform log-gap cost
195-
static float moveGain(const BPFunctionNode &N, bool FromLeftToRight,
196+
LLVM_ABI static float moveGain(const BPFunctionNode &N, bool FromLeftToRight,
196197
const SignaturesT &Signatures);
197198
friend class BalancedPartitioningTest_MoveGain_Test;
198199
};

llvm/include/llvm/Support/Base64.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef LLVM_SUPPORT_BASE64_H
1414
#define LLVM_SUPPORT_BASE64_H
1515

16+
#include "llvm/Support/Compiler.h"
1617
#include "llvm/Support/Error.h"
1718
#include <cstdint>
1819
#include <string>
@@ -54,7 +55,7 @@ template <class InputBytes> std::string encodeBase64(InputBytes const &Bytes) {
5455
return Buffer;
5556
}
5657

57-
llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
58+
LLVM_ABI llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
5859

5960
} // end namespace llvm
6061

llvm/include/llvm/Support/BinaryStreamError.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_SUPPORT_BINARYSTREAMERROR_H
1010
#define LLVM_SUPPORT_BINARYSTREAMERROR_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/StringRef.h"
1314
#include "llvm/Support/Error.h"
1415

@@ -24,7 +25,7 @@ enum class stream_error_code {
2425
};
2526

2627
/// Base class for errors originating when parsing raw PDB files
27-
class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
28+
class LLVM_ABI BinaryStreamError : public ErrorInfo<BinaryStreamError> {
2829
public:
2930
static char ID;
3031
explicit BinaryStreamError(stream_error_code C);

llvm/include/llvm/Support/BinaryStreamReader.h

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_SUPPORT_BINARYSTREAMREADER_H
1010
#define LLVM_SUPPORT_BINARYSTREAMREADER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/ADT/StringRef.h"
1415
#include "llvm/Support/Alignment.h"
@@ -29,10 +30,10 @@ namespace llvm {
2930
class BinaryStreamReader {
3031
public:
3132
BinaryStreamReader() = default;
32-
explicit BinaryStreamReader(BinaryStreamRef Ref);
33-
explicit BinaryStreamReader(BinaryStream &Stream);
34-
explicit BinaryStreamReader(ArrayRef<uint8_t> Data, llvm::endianness Endian);
35-
explicit BinaryStreamReader(StringRef Data, llvm::endianness Endian);
33+
LLVM_ABI explicit BinaryStreamReader(BinaryStreamRef Ref);
34+
LLVM_ABI explicit BinaryStreamReader(BinaryStream &Stream);
35+
LLVM_ABI explicit BinaryStreamReader(ArrayRef<uint8_t> Data, llvm::endianness Endian);
36+
LLVM_ABI explicit BinaryStreamReader(StringRef Data, llvm::endianness Endian);
3637

3738
BinaryStreamReader(const BinaryStreamReader &Other) = default;
3839

@@ -46,7 +47,7 @@ class BinaryStreamReader {
4647
///
4748
/// \returns a success error code if the data was successfully read, otherwise
4849
/// returns an appropriate error code.
49-
Error readLongestContiguousChunk(ArrayRef<uint8_t> &Buffer);
50+
LLVM_ABI Error readLongestContiguousChunk(ArrayRef<uint8_t> &Buffer);
5051

5152
/// Read \p Size bytes from the underlying stream at the current offset and
5253
/// and set \p Buffer to the resulting data slice. Whether a copy occurs
@@ -55,7 +56,7 @@ class BinaryStreamReader {
5556
///
5657
/// \returns a success error code if the data was successfully read, otherwise
5758
/// returns an appropriate error code.
58-
Error readBytes(ArrayRef<uint8_t> &Buffer, uint32_t Size);
59+
LLVM_ABI Error readBytes(ArrayRef<uint8_t> &Buffer, uint32_t Size);
5960

6061
/// Read an integer of the specified endianness into \p Dest and update the
6162
/// stream's offset. The data is always copied from the stream's underlying
@@ -91,44 +92,44 @@ class BinaryStreamReader {
9192
///
9293
/// \returns a success error code if the data was successfully read, otherwise
9394
/// returns an appropriate error code.
94-
Error readULEB128(uint64_t &Dest);
95+
LLVM_ABI Error readULEB128(uint64_t &Dest);
9596

9697
/// Read a signed LEB128 encoded value.
9798
///
9899
/// \returns a success error code if the data was successfully read, otherwise
99100
/// returns an appropriate error code.
100-
Error readSLEB128(int64_t &Dest);
101+
LLVM_ABI Error readSLEB128(int64_t &Dest);
101102

102103
/// Read a null terminated string from \p Dest. Whether a copy occurs depends
103104
/// on the implementation of the underlying stream. Updates the stream's
104105
/// offset to point after the newly read data.
105106
///
106107
/// \returns a success error code if the data was successfully read, otherwise
107108
/// returns an appropriate error code.
108-
Error readCString(StringRef &Dest);
109+
LLVM_ABI Error readCString(StringRef &Dest);
109110

110111
/// Similar to readCString, however read a null-terminated UTF16 string
111112
/// instead.
112113
///
113114
/// \returns a success error code if the data was successfully read, otherwise
114115
/// returns an appropriate error code.
115-
Error readWideString(ArrayRef<UTF16> &Dest);
116+
LLVM_ABI Error readWideString(ArrayRef<UTF16> &Dest);
116117

117118
/// Read a \p Length byte string into \p Dest. Whether a copy occurs depends
118119
/// on the implementation of the underlying stream. Updates the stream's
119120
/// offset to point after the newly read data.
120121
///
121122
/// \returns a success error code if the data was successfully read, otherwise
122123
/// returns an appropriate error code.
123-
Error readFixedString(StringRef &Dest, uint32_t Length);
124+
LLVM_ABI Error readFixedString(StringRef &Dest, uint32_t Length);
124125

125126
/// Read the entire remainder of the underlying stream into \p Ref. This is
126127
/// equivalent to calling getUnderlyingStream().slice(Offset). Updates the
127128
/// stream's offset to point to the end of the stream. Never causes a copy.
128129
///
129130
/// \returns a success error code if the data was successfully read, otherwise
130131
/// returns an appropriate error code.
131-
Error readStreamRef(BinaryStreamRef &Ref);
132+
LLVM_ABI Error readStreamRef(BinaryStreamRef &Ref);
132133

133134
/// Read \p Length bytes from the underlying stream into \p Ref. This is
134135
/// equivalent to calling getUnderlyingStream().slice(Offset, Length).
@@ -137,7 +138,7 @@ class BinaryStreamReader {
137138
///
138139
/// \returns a success error code if the data was successfully read, otherwise
139140
/// returns an appropriate error code.
140-
Error readStreamRef(BinaryStreamRef &Ref, uint32_t Length);
141+
LLVM_ABI Error readStreamRef(BinaryStreamRef &Ref, uint32_t Length);
141142

142143
/// Read \p Length bytes from the underlying stream into \p Ref. This is
143144
/// equivalent to calling getUnderlyingStream().slice(Offset, Length).
@@ -146,7 +147,7 @@ class BinaryStreamReader {
146147
///
147148
/// \returns a success error code if the data was successfully read, otherwise
148149
/// returns an appropriate error code.
149-
Error readSubstream(BinarySubstreamRef &Ref, uint32_t Length);
150+
LLVM_ABI Error readSubstream(BinarySubstreamRef &Ref, uint32_t Length);
150151

151152
/// Get a pointer to an object of type T from the underlying stream, as if by
152153
/// memcpy, and store the result into \p Dest. It is up to the caller to
@@ -251,17 +252,17 @@ class BinaryStreamReader {
251252
///
252253
/// \returns a success error code if at least \p Amount bytes remain in the
253254
/// stream, otherwise returns an appropriate error code.
254-
Error skip(uint64_t Amount);
255+
LLVM_ABI Error skip(uint64_t Amount);
255256

256257
/// Examine the next byte of the underlying stream without advancing the
257258
/// stream's offset. If the stream is empty the behavior is undefined.
258259
///
259260
/// \returns the next byte in the stream.
260-
uint8_t peek() const;
261+
LLVM_ABI uint8_t peek() const;
261262

262-
Error padToAlignment(uint32_t Align);
263+
LLVM_ABI Error padToAlignment(uint32_t Align);
263264

264-
std::pair<BinaryStreamReader, BinaryStreamReader>
265+
LLVM_ABI std::pair<BinaryStreamReader, BinaryStreamReader>
265266
split(uint64_t Offset) const;
266267

267268
private:

llvm/include/llvm/Support/BinaryStreamRef.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_SUPPORT_BINARYSTREAMREF_H
1010
#define LLVM_SUPPORT_BINARYSTREAMREF_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/Support/BinaryStream.h"
1415
#include "llvm/Support/BinaryStreamError.h"
@@ -160,11 +161,11 @@ class BinaryStreamRef
160161

161162
public:
162163
BinaryStreamRef() = default;
163-
BinaryStreamRef(BinaryStream &Stream);
164-
BinaryStreamRef(BinaryStream &Stream, uint64_t Offset,
164+
LLVM_ABI BinaryStreamRef(BinaryStream &Stream);
165+
LLVM_ABI BinaryStreamRef(BinaryStream &Stream, uint64_t Offset,
165166
std::optional<uint64_t> Length);
166-
explicit BinaryStreamRef(ArrayRef<uint8_t> Data, llvm::endianness Endian);
167-
explicit BinaryStreamRef(StringRef Data, llvm::endianness Endian);
167+
LLVM_ABI explicit BinaryStreamRef(ArrayRef<uint8_t> Data, llvm::endianness Endian);
168+
LLVM_ABI explicit BinaryStreamRef(StringRef Data, llvm::endianness Endian);
168169

169170
BinaryStreamRef(const BinaryStreamRef &Other) = default;
170171
BinaryStreamRef &operator=(const BinaryStreamRef &Other) = default;
@@ -181,15 +182,15 @@ class BinaryStreamRef
181182
/// \returns a success error code if the entire range of data is within the
182183
/// bounds of this BinaryStreamRef's view and the implementation could read
183184
/// the data, and an appropriate error code otherwise.
184-
Error readBytes(uint64_t Offset, uint64_t Size,
185+
LLVM_ABI Error readBytes(uint64_t Offset, uint64_t Size,
185186
ArrayRef<uint8_t> &Buffer) const;
186187

187188
/// Given an Offset into this BinaryStreamRef, return a reference to the
188189
/// largest buffer the stream could support without necessitating a copy.
189190
///
190191
/// \returns a success error code if implementation could read the data,
191192
/// and an appropriate error code otherwise.
192-
Error readLongestContiguousChunk(uint64_t Offset,
193+
LLVM_ABI Error readLongestContiguousChunk(uint64_t Offset,
193194
ArrayRef<uint8_t> &Buffer) const;
194195
};
195196

@@ -233,10 +234,10 @@ class WritableBinaryStreamRef
233234

234235
public:
235236
WritableBinaryStreamRef() = default;
236-
WritableBinaryStreamRef(WritableBinaryStream &Stream);
237-
WritableBinaryStreamRef(WritableBinaryStream &Stream, uint64_t Offset,
237+
LLVM_ABI WritableBinaryStreamRef(WritableBinaryStream &Stream);
238+
LLVM_ABI WritableBinaryStreamRef(WritableBinaryStream &Stream, uint64_t Offset,
238239
std::optional<uint64_t> Length);
239-
explicit WritableBinaryStreamRef(MutableArrayRef<uint8_t> Data,
240+
LLVM_ABI explicit WritableBinaryStreamRef(MutableArrayRef<uint8_t> Data,
240241
llvm::endianness Endian);
241242
WritableBinaryStreamRef(const WritableBinaryStreamRef &Other) = default;
242243
WritableBinaryStreamRef &
@@ -255,13 +256,13 @@ class WritableBinaryStreamRef
255256
/// \returns a success error code if the data could fit within the underlying
256257
/// stream at the specified location and the implementation could write the
257258
/// data, and an appropriate error code otherwise.
258-
Error writeBytes(uint64_t Offset, ArrayRef<uint8_t> Data) const;
259+
LLVM_ABI Error writeBytes(uint64_t Offset, ArrayRef<uint8_t> Data) const;
259260

260261
/// Conver this WritableBinaryStreamRef to a read-only BinaryStreamRef.
261-
operator BinaryStreamRef() const;
262+
LLVM_ABI operator BinaryStreamRef() const;
262263

263264
/// For buffered streams, commits changes to the backing store.
264-
Error commit();
265+
LLVM_ABI Error commit();
265266
};
266267

267268
} // end namespace llvm

0 commit comments

Comments
 (0)