Skip to content

Commit 92e80d4

Browse files
authored
Add missing LLVM_ABI annotations (#165908)
1 parent 4a383f9 commit 92e80d4

File tree

13 files changed

+35
-34
lines changed

13 files changed

+35
-34
lines changed

llvm/include/llvm/Analysis/IR2Vec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ enum class IR2VecKind { Symbolic, FlowAware };
7272

7373
namespace ir2vec {
7474

75-
extern llvm::cl::OptionCategory IR2VecCategory;
75+
LLVM_ABI extern llvm::cl::OptionCategory IR2VecCategory;
7676
LLVM_ABI extern cl::opt<float> OpcWeight;
7777
LLVM_ABI extern cl::opt<float> TypeWeight;
7878
LLVM_ABI extern cl::opt<float> ArgWeight;

llvm/include/llvm/CodeGen/MIR2Vec.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace mir2vec {
7373
class MIREmbedder;
7474
class SymbolicMIREmbedder;
7575

76-
extern llvm::cl::OptionCategory MIR2VecCategory;
76+
LLVM_ABI extern llvm::cl::OptionCategory MIR2VecCategory;
7777
extern cl::opt<float> OpcWeight, CommonOperandWeight, RegOperandWeight;
7878

7979
using Embedding = ir2vec::Embedding;
@@ -154,14 +154,14 @@ class MIRVocabulary {
154154
void buildRegisterOperandMapping();
155155

156156
/// Get canonical index for a machine opcode
157-
unsigned getCanonicalOpcodeIndex(unsigned Opcode) const;
157+
LLVM_ABI unsigned getCanonicalOpcodeIndex(unsigned Opcode) const;
158158

159159
/// Get index for a common (non-register) machine operand
160160
unsigned
161161
getCommonOperandIndex(MachineOperand::MachineOperandType OperandType) const;
162162

163163
/// Get index for a register machine operand
164-
unsigned getRegisterOperandIndex(Register Reg) const;
164+
LLVM_ABI unsigned getRegisterOperandIndex(Register Reg) const;
165165

166166
// Accessors for operand types
167167
const Embedding &
@@ -192,7 +192,7 @@ class MIRVocabulary {
192192

193193
/// Get entity ID (flat index) for a common operand type
194194
/// This is used for triplet generation
195-
unsigned getEntityIDForCommonOperand(
195+
LLVM_ABI unsigned getEntityIDForCommonOperand(
196196
MachineOperand::MachineOperandType OperandType) const {
197197
return Layout.CommonOperandBase + getCommonOperandIndex(OperandType);
198198
}
@@ -221,7 +221,7 @@ class MIRVocabulary {
221221
bool IsPhysical = true) const;
222222

223223
/// Get the string key for a vocabulary entry at the given position
224-
std::string getStringKey(unsigned Pos) const;
224+
LLVM_ABI std::string getStringKey(unsigned Pos) const;
225225

226226
unsigned getDimension() const { return Storage.getDimension(); }
227227

@@ -268,7 +268,7 @@ class MIRVocabulary {
268268
const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI);
269269

270270
/// Create a dummy vocabulary for testing purposes.
271-
static Expected<MIRVocabulary>
271+
LLVM_ABI static Expected<MIRVocabulary>
272272
createDummyVocabForTest(const TargetInstrInfo &TII,
273273
const TargetRegisterInfo &TRI,
274274
const MachineRegisterInfo &MRI, unsigned Dim = 1);
@@ -302,10 +302,10 @@ class MIREmbedder {
302302
RegOperandWeight(mir2vec::RegOperandWeight) {}
303303

304304
/// Function to compute embeddings.
305-
Embedding computeEmbeddings() const;
305+
LLVM_ABI Embedding computeEmbeddings() const;
306306

307307
/// Function to compute the embedding for a given machine basic block.
308-
Embedding computeEmbeddings(const MachineBasicBlock &MBB) const;
308+
LLVM_ABI Embedding computeEmbeddings(const MachineBasicBlock &MBB) const;
309309

310310
/// Function to compute the embedding for a given machine instruction.
311311
/// Specific to the kind of embeddings being computed.
@@ -316,9 +316,9 @@ class MIREmbedder {
316316

317317
/// Factory method to create an Embedder object of the specified kind
318318
/// Returns nullptr if the requested kind is not supported.
319-
static std::unique_ptr<MIREmbedder> create(MIR2VecKind Mode,
320-
const MachineFunction &MF,
321-
const MIRVocabulary &Vocab);
319+
LLVM_ABI static std::unique_ptr<MIREmbedder>
320+
create(MIR2VecKind Mode, const MachineFunction &MF,
321+
const MIRVocabulary &Vocab);
322322

323323
/// Computes and returns the embedding for a given machine instruction MI in
324324
/// the machine function MF.
@@ -369,7 +369,7 @@ class MIR2VecVocabProvider {
369369
public:
370370
MIR2VecVocabProvider(const MachineModuleInfo &MMI) : MMI(MMI) {}
371371

372-
Expected<mir2vec::MIRVocabulary> getVocabulary(const Module &M);
372+
LLVM_ABI Expected<mir2vec::MIRVocabulary> getVocabulary(const Module &M);
373373

374374
private:
375375
Error readVocabulary(VocabMap &OpcVocab, VocabMap &CommonOperandVocab,
@@ -454,7 +454,7 @@ class MIR2VecPrinterLegacyPass : public MachineFunctionPass {
454454
};
455455

456456
/// Create a machine pass that prints MIR2Vec embeddings
457-
MachineFunctionPass *createMIR2VecPrinterLegacyPass(raw_ostream &OS);
457+
LLVM_ABI MachineFunctionPass *createMIR2VecPrinterLegacyPass(raw_ostream &OS);
458458

459459
} // namespace llvm
460460

llvm/include/llvm/IR/DataLayout.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ class DataLayout {
590590
///
591591
/// This is the amount that alloca reserves for this type. For example,
592592
/// returns 12 or 16 for x86_fp80, depending on alignment.
593-
TypeSize getTypeAllocSize(Type *Ty) const;
593+
LLVM_ABI TypeSize getTypeAllocSize(Type *Ty) const;
594594

595595
/// Returns the offset in bits between successive objects of the
596596
/// specified type, including alignment padding; always a multiple of 8.

llvm/include/llvm/Object/SFrameParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ template <endianness E> class SFrameParser<E>::FallibleFREIterator {
9090
uint32_t Idx, uint32_t Size, uint64_t Offset)
9191
: Data(Data), FREType(FREType), Idx(Idx), Size(Size), Offset(Offset) {}
9292

93-
Error inc();
93+
LLVM_ABI Error inc();
9494
const FrameRowEntry &operator*() const { return FRE; }
9595

9696
friend bool operator==(const FallibleFREIterator &LHS,

llvm/include/llvm/Support/JSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class Object {
154154
LLVM_ABI const json::Array *getArray(StringRef K) const;
155155
LLVM_ABI json::Array *getArray(StringRef K);
156156

157-
friend bool operator==(const Object &LHS, const Object &RHS);
157+
friend LLVM_ABI bool operator==(const Object &LHS, const Object &RHS);
158158
};
159159
LLVM_ABI bool operator==(const Object &LHS, const Object &RHS);
160160
inline bool operator!=(const Object &LHS, const Object &RHS) {

llvm/include/llvm/Support/SourceMgr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,18 @@ class SourceMgr {
103103

104104
public:
105105
/// Create new source manager without support for include files.
106-
SourceMgr();
106+
LLVM_ABI SourceMgr();
107107
/// Create new source manager with the capability of finding include files
108108
/// via the provided file system.
109109
explicit SourceMgr(IntrusiveRefCntPtr<vfs::FileSystem> FS);
110110
SourceMgr(const SourceMgr &) = delete;
111111
SourceMgr &operator=(const SourceMgr &) = delete;
112112
SourceMgr(SourceMgr &&);
113113
SourceMgr &operator=(SourceMgr &&);
114-
~SourceMgr();
114+
LLVM_ABI ~SourceMgr();
115115

116116
IntrusiveRefCntPtr<vfs::FileSystem> getVirtualFileSystem() const;
117-
void setVirtualFileSystem(IntrusiveRefCntPtr<vfs::FileSystem> FS);
117+
LLVM_ABI void setVirtualFileSystem(IntrusiveRefCntPtr<vfs::FileSystem> FS);
118118

119119
/// Return the include directories of this source manager.
120120
ArrayRef<std::string> getIncludeDirs() const { return IncludeDirectories; }

llvm/include/llvm/Support/VirtualFileSystem.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,9 @@ class LLVM_ABI RedirectingFileSystem
11161116
/// Collect all pairs of <virtual path, real path> entries from the
11171117
/// \p VFS. This is used by the module dependency collector to forward
11181118
/// the entries into the reproducer output VFS YAML file.
1119-
void collectVFSEntries(RedirectingFileSystem &VFS,
1120-
SmallVectorImpl<YAMLVFSEntry> &CollectedEntries);
1119+
LLVM_ABI void
1120+
collectVFSEntries(RedirectingFileSystem &VFS,
1121+
SmallVectorImpl<YAMLVFSEntry> &CollectedEntries);
11211122

11221123
class YAMLVFSWriter {
11231124
std::vector<YAMLVFSEntry> Mappings;

llvm/include/llvm/Support/VirtualOutputBackend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace llvm::vfs {
3232
/// If virtual functions are added here, also add them to \a
3333
/// ProxyOutputBackend.
3434
class OutputBackend : public RefCountedBase<OutputBackend> {
35-
virtual void anchor();
35+
LLVM_ABI virtual void anchor();
3636

3737
public:
3838
/// Get a backend that points to the same destination as this one but that
@@ -47,7 +47,7 @@ class OutputBackend : public RefCountedBase<OutputBackend> {
4747
/// have been customized).
4848
///
4949
/// Thread-safe.
50-
Expected<OutputFile>
50+
LLVM_ABI Expected<OutputFile>
5151
createFile(const Twine &Path,
5252
std::optional<OutputConfig> Config = std::nullopt);
5353

llvm/include/llvm/Support/VirtualOutputBackends.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ class ProxyOutputBackend : public OutputBackend {
7777

7878
/// An output backend that creates files on disk, wrapping APIs in sys::fs.
7979
class OnDiskOutputBackend : public OutputBackend {
80-
void anchor() override;
80+
LLVM_ABI void anchor() override;
8181

8282
protected:
8383
IntrusiveRefCntPtr<OutputBackend> cloneImpl() const override {
8484
return clone();
8585
}
8686

87-
Expected<std::unique_ptr<OutputFileImpl>>
87+
LLVM_ABI Expected<std::unique_ptr<OutputFileImpl>>
8888
createFileImpl(StringRef Path, std::optional<OutputConfig> Config) override;
8989

9090
public:

llvm/include/llvm/Support/VirtualOutputError.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class OutputError : public ErrorInfo<OutputError, ECError> {
4343
void log(raw_ostream &OS) const override;
4444

4545
// Used by ErrorInfo::classID.
46-
static char ID;
46+
LLVM_ABI static char ID;
4747

4848
OutputError(const Twine &OutputPath, std::error_code EC)
4949
: ErrorInfo<OutputError, ECError>(EC), OutputPath(OutputPath.str()) {
@@ -99,7 +99,7 @@ class TempFileOutputError : public ErrorInfo<TempFileOutputError, OutputError> {
9999
void log(raw_ostream &OS) const override;
100100

101101
// Used by ErrorInfo::classID.
102-
static char ID;
102+
LLVM_ABI static char ID;
103103

104104
TempFileOutputError(const Twine &TempPath, const Twine &OutputPath,
105105
std::error_code EC)

0 commit comments

Comments
 (0)