@@ -73,7 +73,7 @@ namespace mir2vec {
7373class MIREmbedder ;
7474class SymbolicMIREmbedder ;
7575
76- extern llvm::cl::OptionCategory MIR2VecCategory;
76+ LLVM_ABI extern llvm::cl::OptionCategory MIR2VecCategory;
7777extern cl::opt<float > OpcWeight, CommonOperandWeight, RegOperandWeight;
7878
7979using 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 {
369369public:
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
374374private:
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
0 commit comments