[llvm] [llvm] Fix most LLVM_ABI annotations in MC/MCA (PR #202930)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 04:00:22 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tools-llvm-mca

Author: Fabrice de Gans (Steelskin)

<details>
<summary>Changes</summary>

This updates most LLVM_ABI annotations in the MC/MCA headers to match expected usage:
* All public APIs should be properly annotated.
* Inlined functions should not be annotated.

These changes were done by a script fixing annotations on LLVM public headers and manually checked.

This effort is tracked in #<!-- -->109483.

---

Patch is 42.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/202930.diff


40 Files Affected:

- (modified) llvm/include/llvm/MC/ConstantPools.h (+10-10) 
- (modified) llvm/include/llvm/MC/DXContainerPSVInfo.h (+7-5) 
- (modified) llvm/include/llvm/MC/MCAsmInfoCOFF.h (+3-3) 
- (modified) llvm/include/llvm/MC/MCAsmInfoDarwin.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCAsmInfoELF.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCAsmInfoGOFF.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCAsmInfoWasm.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCAsmInfoXCOFF.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCCodeView.h (+35-34) 
- (modified) llvm/include/llvm/MC/MCDXContainerWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h (+1-2) 
- (modified) llvm/include/llvm/MC/MCELFObjectWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCELFStreamer.h (+6-6) 
- (modified) llvm/include/llvm/MC/MCGOFFObjectWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCLabel.h (+4-2) 
- (modified) llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h (+5-3) 
- (modified) llvm/include/llvm/MC/MCSFrame.h (+4-3) 
- (modified) llvm/include/llvm/MC/MCSPIRVObjectWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCSectionCOFF.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCSectionXCOFF.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCSymbol.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCSymbolELF.h (+15-15) 
- (modified) llvm/include/llvm/MC/MCSymbolGOFF.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCSymbolXCOFF.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCWasmObjectWriter.h (+3-3) 
- (modified) llvm/include/llvm/MC/MCWasmStreamer.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCWin64EH.h (+3-3) 
- (modified) llvm/include/llvm/MC/MCWinCOFFObjectWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCWinCOFFStreamer.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCXCOFFObjectWriter.h (+2-2) 
- (modified) llvm/include/llvm/MC/MCXCOFFStreamer.h (+1-1) 
- (modified) llvm/include/llvm/MC/TargetRegistry.h (+1-1) 
- (modified) llvm/include/llvm/MCA/CustomBehaviour.h (+1-1) 
- (modified) llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h (+30-28) 
- (modified) llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h (+6-6) 
- (modified) llvm/include/llvm/MCA/Stages/DispatchStage.h (+1-1) 
- (modified) llvm/include/llvm/MCA/Stages/ExecuteStage.h (+1-1) 
- (modified) llvm/include/llvm/MCA/Stages/InOrderIssueStage.h (+4-4) 
- (modified) llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h (+1-1) 
- (modified) llvm/include/llvm/MCA/Stages/RetireStage.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/MC/ConstantPools.h b/llvm/include/llvm/MC/ConstantPools.h
index ff21ccda07a83..2ce9cb25fd5be 100644
--- a/llvm/include/llvm/MC/ConstantPools.h
+++ b/llvm/include/llvm/MC/ConstantPools.h
@@ -60,16 +60,16 @@ class ConstantPool {
   // \param Size is the size in bytes of the entry
   //
   // \returns a MCExpr that references the newly inserted value
-  const MCExpr *addEntry(const MCExpr *Value, MCContext &Context,
-                         unsigned Size, SMLoc Loc);
+  LLVM_ABI const MCExpr *addEntry(const MCExpr *Value, MCContext &Context,
+                                  unsigned Size, SMLoc Loc);
 
   // Emit the contents of the constant pool using the provided streamer.
-  void emitEntries(MCStreamer &Streamer);
+  LLVM_ABI void emitEntries(MCStreamer &Streamer);
 
   // Return true if the constant pool is empty
-  bool empty();
+  LLVM_ABI bool empty();
 
-  void clearCache();
+  LLVM_ABI void clearCache();
 };
 
 class AssemblerConstantPools {
@@ -91,11 +91,11 @@ class AssemblerConstantPools {
   ConstantPoolMapTy ConstantPools;
 
 public:
-  void emitAll(MCStreamer &Streamer);
-  void emitForCurrentSection(MCStreamer &Streamer);
-  void clearCacheForCurrentSection(MCStreamer &Streamer);
-  const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr,
-                         unsigned Size, SMLoc Loc);
+  LLVM_ABI void emitAll(MCStreamer &Streamer);
+  LLVM_ABI void emitForCurrentSection(MCStreamer &Streamer);
+  LLVM_ABI void clearCacheForCurrentSection(MCStreamer &Streamer);
+  LLVM_ABI const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr,
+                                  unsigned Size, SMLoc Loc);
 
 private:
   ConstantPool *getConstantPool(MCSection *Section);
diff --git a/llvm/include/llvm/MC/DXContainerPSVInfo.h b/llvm/include/llvm/MC/DXContainerPSVInfo.h
index 1129f520be2cc..0de0fbb36d957 100644
--- a/llvm/include/llvm/MC/DXContainerPSVInfo.h
+++ b/llvm/include/llvm/MC/DXContainerPSVInfo.h
@@ -73,11 +73,13 @@ struct PSVRuntimeInfo {
   // Serialize PSVInfo into the provided raw_ostream. The version field
   // specifies the data version to encode, the default value specifies encoding
   // the highest supported version.
-  void write(raw_ostream &OS,
-             uint32_t Version = std::numeric_limits<uint32_t>::max()) const;
+  LLVM_ABI void
+  write(raw_ostream &OS,
+        uint32_t Version = std::numeric_limits<uint32_t>::max()) const;
 
-  void finalize(Triple::EnvironmentType Stage,
-                uint32_t Version = std::numeric_limits<uint32_t>::max());
+  LLVM_ABI void
+  finalize(Triple::EnvironmentType Stage,
+           uint32_t Version = std::numeric_limits<uint32_t>::max());
 
 private:
   SmallVector<uint32_t, 64> IndexBuffer;
@@ -110,7 +112,7 @@ class Signature {
                                Register, Mask, ExclusiveMask, MinPrecision});
   }
 
-  void write(raw_ostream &OS);
+  LLVM_ABI void write(raw_ostream &OS);
 };
 
 } // namespace mcdxbc
diff --git a/llvm/include/llvm/MC/MCAsmInfoCOFF.h b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
index 8f46fe9c6316f..566f5de62444b 100644
--- a/llvm/include/llvm/MC/MCAsmInfoCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
@@ -13,7 +13,7 @@
 
 namespace llvm {
 
-class MCAsmInfoCOFF : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoCOFF : public MCAsmInfo {
   virtual void anchor();
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
                             raw_ostream &) const final;
@@ -23,14 +23,14 @@ class MCAsmInfoCOFF : public MCAsmInfo {
   explicit MCAsmInfoCOFF(const MCTargetOptions &Options);
 };
 
-class MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
+class LLVM_ABI MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
   void anchor() override;
 
 protected:
   explicit MCAsmInfoMicrosoft(const MCTargetOptions &Options);
 };
 
-class MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
+class LLVM_ABI MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
   void anchor() override;
 
 protected:
diff --git a/llvm/include/llvm/MC/MCAsmInfoDarwin.h b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
index 9ee6ab1db043b..3afbd7e6bad43 100644
--- a/llvm/include/llvm/MC/MCAsmInfoDarwin.h
+++ b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-class MCAsmInfoDarwin : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoDarwin : public MCAsmInfo {
 public:
   explicit MCAsmInfoDarwin(const MCTargetOptions &Options);
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
diff --git a/llvm/include/llvm/MC/MCAsmInfoELF.h b/llvm/include/llvm/MC/MCAsmInfoELF.h
index 1d1d67e0f7582..b6bc762488e5b 100644
--- a/llvm/include/llvm/MC/MCAsmInfoELF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoELF.h
@@ -13,7 +13,7 @@
 
 namespace llvm {
 
-class MCAsmInfoELF : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoELF : public MCAsmInfo {
   virtual void anchor();
   MCSection *getStackSection(MCContext &Ctx, bool Exec) const override;
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
diff --git a/llvm/include/llvm/MC/MCAsmInfoGOFF.h b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
index 6de0c87b41e15..5fcfcc31707b1 100644
--- a/llvm/include/llvm/MC/MCAsmInfoGOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
@@ -18,7 +18,7 @@
 #include "llvm/MC/MCAsmInfo.h"
 
 namespace llvm {
-class MCAsmInfoGOFF : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoGOFF : public MCAsmInfo {
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
                             raw_ostream &) const final;
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoWasm.h b/llvm/include/llvm/MC/MCAsmInfoWasm.h
index 0774def6f4676..0b99c1a4eb30f 100644
--- a/llvm/include/llvm/MC/MCAsmInfoWasm.h
+++ b/llvm/include/llvm/MC/MCAsmInfoWasm.h
@@ -12,7 +12,7 @@
 #include "llvm/MC/MCAsmInfo.h"
 
 namespace llvm {
-class MCAsmInfoWasm : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoWasm : public MCAsmInfo {
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
                             raw_ostream &) const final;
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
index 4d417a714ab03..920f873c07417 100644
--- a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
@@ -13,7 +13,7 @@
 
 namespace llvm {
 
-class MCAsmInfoXCOFF : public MCAsmInfo {
+class LLVM_ABI MCAsmInfoXCOFF : public MCAsmInfo {
 protected:
   MCAsmInfoXCOFF(const MCTargetOptions &Options);
   void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
diff --git a/llvm/include/llvm/MC/MCCodeView.h b/llvm/include/llvm/MC/MCCodeView.h
index 76e15b8518439..7f871f6816dbb 100644
--- a/llvm/include/llvm/MC/MCCodeView.h
+++ b/llvm/include/llvm/MC/MCCodeView.h
@@ -148,80 +148,81 @@ class CodeViewContext {
   CodeViewContext &operator=(const CodeViewContext &other) = delete;
   CodeViewContext(const CodeViewContext &other) = delete;
 
-  void finish();
+  LLVM_ABI void finish();
 
-  bool isValidFileNumber(unsigned FileNumber) const;
-  bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename,
-               ArrayRef<uint8_t> ChecksumBytes, uint8_t ChecksumKind);
+  LLVM_ABI bool isValidFileNumber(unsigned FileNumber) const;
+  LLVM_ABI bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename,
+                        ArrayRef<uint8_t> ChecksumBytes, uint8_t ChecksumKind);
 
   /// Records the function id of a normal function. Returns false if the
   /// function id has already been used, and true otherwise.
-  bool recordFunctionId(unsigned FuncId);
+  LLVM_ABI bool recordFunctionId(unsigned FuncId);
 
   /// Records the function id of an inlined call site. Records the "inlined at"
   /// location info of the call site, including what function or inlined call
   /// site it was inlined into. Returns false if the function id has already
   /// been used, and true otherwise.
-  bool recordInlinedCallSiteId(unsigned FuncId, unsigned IAFunc,
-                               unsigned IAFile, unsigned IALine,
-                               unsigned IACol);
+  LLVM_ABI bool recordInlinedCallSiteId(unsigned FuncId, unsigned IAFunc,
+                                        unsigned IAFile, unsigned IALine,
+                                        unsigned IACol);
 
   /// Retreive the function info if this is a valid function id, or nullptr.
-  MCCVFunctionInfo *getCVFunctionInfo(unsigned FuncId);
+  LLVM_ABI MCCVFunctionInfo *getCVFunctionInfo(unsigned FuncId);
 
   /// Saves the information from the currently parsed .cv_loc directive
   /// and sets CVLocSeen.  When the next instruction is assembled an entry
   /// in the line number table with this information and the address of the
   /// instruction will be created.
-  void recordCVLoc(MCContext &Ctx, const MCSymbol *Label, unsigned FunctionId,
-                   unsigned FileNo, unsigned Line, unsigned Column,
-                   bool PrologueEnd, bool IsStmt);
+  LLVM_ABI void recordCVLoc(MCContext &Ctx, const MCSymbol *Label,
+                            unsigned FunctionId, unsigned FileNo, unsigned Line,
+                            unsigned Column, bool PrologueEnd, bool IsStmt);
 
   /// Add a line entry.
-  void addLineEntry(const MCCVLoc &LineEntry);
+  LLVM_ABI void addLineEntry(const MCCVLoc &LineEntry);
 
-  std::vector<MCCVLoc> getFunctionLineEntries(unsigned FuncId);
+  LLVM_ABI std::vector<MCCVLoc> getFunctionLineEntries(unsigned FuncId);
 
-  std::pair<size_t, size_t> getLineExtent(unsigned FuncId);
-  std::pair<size_t, size_t> getLineExtentIncludingInlinees(unsigned FuncId);
+  LLVM_ABI std::pair<size_t, size_t> getLineExtent(unsigned FuncId);
+  LLVM_ABI std::pair<size_t, size_t>
+  getLineExtentIncludingInlinees(unsigned FuncId);
 
-  ArrayRef<MCCVLoc> getLinesForExtent(size_t L, size_t R);
+  LLVM_ABI ArrayRef<MCCVLoc> getLinesForExtent(size_t L, size_t R);
 
   /// Emits a line table substream.
-  void emitLineTableForFunction(MCObjectStreamer &OS, unsigned FuncId,
-                                const MCSymbol *FuncBegin,
-                                const MCSymbol *FuncEnd);
+  LLVM_ABI void emitLineTableForFunction(MCObjectStreamer &OS, unsigned FuncId,
+                                         const MCSymbol *FuncBegin,
+                                         const MCSymbol *FuncEnd);
 
-  void emitInlineLineTableForFunction(MCObjectStreamer &OS,
-                                      unsigned PrimaryFunctionId,
-                                      unsigned SourceFileId,
-                                      unsigned SourceLineNum,
-                                      const MCSymbol *FnStartSym,
-                                      const MCSymbol *FnEndSym);
+  LLVM_ABI void emitInlineLineTableForFunction(MCObjectStreamer &OS,
+                                               unsigned PrimaryFunctionId,
+                                               unsigned SourceFileId,
+                                               unsigned SourceLineNum,
+                                               const MCSymbol *FnStartSym,
+                                               const MCSymbol *FnEndSym);
 
   /// Encodes the binary annotations once we have a layout.
-  void encodeInlineLineTable(const MCAssembler &Asm,
-                             MCCVInlineLineTableFragment &F);
+  LLVM_ABI void encodeInlineLineTable(const MCAssembler &Asm,
+                                      MCCVInlineLineTableFragment &F);
 
-  void
+  LLVM_ABI void
   emitDefRange(MCObjectStreamer &OS,
                ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
                StringRef FixedSizePortion);
 
-  void encodeDefRange(const MCAssembler &Asm, MCCVDefRangeFragment &F);
+  LLVM_ABI void encodeDefRange(const MCAssembler &Asm, MCCVDefRangeFragment &F);
 
   /// Emits the string table substream.
-  void emitStringTable(MCObjectStreamer &OS);
+  LLVM_ABI void emitStringTable(MCObjectStreamer &OS);
 
   /// Emits the file checksum substream.
-  void emitFileChecksums(MCObjectStreamer &OS);
+  LLVM_ABI void emitFileChecksums(MCObjectStreamer &OS);
 
   /// Emits the offset into the checksum table of the given file number.
-  void emitFileChecksumOffset(MCObjectStreamer &OS, unsigned FileNo);
+  LLVM_ABI void emitFileChecksumOffset(MCObjectStreamer &OS, unsigned FileNo);
 
   /// Add something to the string table.  Returns the final string as well as
   /// offset into the string table.
-  std::pair<StringRef, unsigned> addToStringTable(StringRef S);
+  LLVM_ABI std::pair<StringRef, unsigned> addToStringTable(StringRef S);
 
 private:
   MCContext *MCCtx;
diff --git a/llvm/include/llvm/MC/MCDXContainerWriter.h b/llvm/include/llvm/MC/MCDXContainerWriter.h
index 9b6ba896a5f09..a734d01392011 100644
--- a/llvm/include/llvm/MC/MCDXContainerWriter.h
+++ b/llvm/include/llvm/MC/MCDXContainerWriter.h
@@ -18,7 +18,7 @@ namespace llvm {
 
 class raw_pwrite_stream;
 
-class MCDXContainerTargetWriter : public MCObjectTargetWriter {
+class LLVM_ABI MCDXContainerTargetWriter : public MCObjectTargetWriter {
 protected:
   MCDXContainerTargetWriter() {}
 
@@ -33,7 +33,7 @@ class MCDXContainerTargetWriter : public MCObjectTargetWriter {
   }
 };
 
-class DXContainerObjectWriter final : public MCObjectWriter {
+class LLVM_ABI DXContainerObjectWriter final : public MCObjectWriter {
   support::endian::Writer W;
   std::unique_ptr<MCDXContainerTargetWriter> TargetObjectWriter;
 
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
index 8af3bb2296ec1..d8e39b4a4add7 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
@@ -24,7 +24,7 @@ namespace llvm {
 /// Symbolize using user-provided, C API, callbacks.
 ///
 /// See llvm-c/Disassembler.h.
-class MCExternalSymbolizer : public MCSymbolizer {
+class LLVM_ABI MCExternalSymbolizer : public MCSymbolizer {
 protected:
   /// \name Hooks for symbolic disassembly via the public 'C' interface.
   /// @{
@@ -52,7 +52,6 @@ class MCExternalSymbolizer : public MCSymbolizer {
                                        int64_t Value,
                                        uint64_t Address) override;
 };
-
 }
 
 #endif
diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h
index 1a87a5c4fc106..c9b40489b459c 100644
--- a/llvm/include/llvm/MC/MCELFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCELFObjectWriter.h
@@ -50,7 +50,7 @@ struct ELFRelocationEntry {
   LLVM_DUMP_METHOD void dump() const { print(errs()); }
 };
 
-class MCELFObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_ABI MCELFObjectTargetWriter : public MCObjectTargetWriter {
   const uint8_t OSABI;
   const uint8_t ABIVersion;
   const uint16_t EMachine;
@@ -139,7 +139,7 @@ class MCELFObjectTargetWriter : public MCObjectTargetWriter {
   }
 };
 
-class ELFObjectWriter final : public MCObjectWriter {
+class LLVM_ABI ELFObjectWriter final : public MCObjectWriter {
   unsigned ELFHeaderEFlags = 0;
 
 public:
diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index 5c3246e42c3f3..e1c86d8b12715 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -28,7 +28,7 @@ class MCCodeEmitter;
 class MCExpr;
 class MCInst;
 
-class MCELFStreamer : public MCObjectStreamer {
+class LLVM_ABI MCELFStreamer : public MCObjectStreamer {
 public:
   MCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
                 std::unique_ptr<MCObjectWriter> OW,
@@ -148,11 +148,11 @@ class MCELFStreamer : public MCObjectStreamer {
   bool SeenIdent = false;
 };
 
-MCELFStreamer *createARMELFStreamer(MCContext &Context,
-                                    std::unique_ptr<MCAsmBackend> TAB,
-                                    std::unique_ptr<MCObjectWriter> OW,
-                                    std::unique_ptr<MCCodeEmitter> Emitter,
-                                    bool IsThumb, bool IsAndroid);
+LLVM_ABI MCELFStreamer *
+createARMELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
+                     std::unique_ptr<MCObjectWriter> OW,
+                     std::unique_ptr<MCCodeEmitter> Emitter, bool IsThumb,
+                     bool IsAndroid);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/MC/MCGOFFObjectWriter.h b/llvm/include/llvm/MC/MCGOFFObjectWriter.h
index a5e7aa10d7430..8bffdd596d11d 100644
--- a/llvm/include/llvm/MC/MCGOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCGOFFObjectWriter.h
@@ -73,7 +73,7 @@ struct GOFFRelocationEntry {
         Action(Action), FetchStore(FetchStore) {}
 };
 
-class GOFFObjectWriter : public MCObjectWriter {
+class LLVM_ABI GOFFObjectWriter : public MCObjectWriter {
   // The target specific GOFF writer instance.
   std::unique_ptr<MCGOFFObjectTargetWriter> TargetObjectWriter;
 
@@ -107,7 +107,7 @@ class GOFFObjectWriter : public MCObjectWriter {
 /// \param MOTW - The target-specific GOFF writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_ABI std::unique_ptr<MCObjectWriter>
 createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
                        raw_pwrite_stream &OS);
 } // namespace llvm
diff --git a/llvm/include/llvm/MC/MCLabel.h b/llvm/include/llvm/MC/MCLabel.h
index 0b8afac8f7548..28246e667947d 100644
--- a/llvm/include/llvm/MC/MCLabel.h
+++ b/llvm/include/llvm/MC/MCLabel.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_MC_MCLABEL_H
 #define LLVM_MC_MCLABEL_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class raw_ostream;
@@ -40,10 +42,10 @@ class MCLabel {
   unsigned incInstance() { return ++Instance; }
 
   /// Print the value to the stream \p OS.
-  void print(raw_ostream &OS) const;
+  LLVM_ABI void print(raw_ostream &OS) const;
 
   /// Print the value to stderr.
-  void dump() const;
+  LLVM_ABI void dump() const;
 };
 
 inline raw_ostream &operator<<(raw_ostream &OS, const MCLabel &Label) {
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
index d692da7402fef..4893c12f13aba 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
 #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MCAsmParser;
@@ -22,9 +24,9 @@ namespace MCParserUtils {
 /// with the given name.
 ///
 /// On success, returns false and sets the Symbol and Value output parameters.
-bool parseAssignmentExpression(StringRef Name, bool allow_redef,
-                               MCAsmParser &Parser, MCSymbol *&Symbol,
-                               const MCExpr *&Value);
+LLVM_ABI bool parseAssignmentExpression(StringRef Name, bool allow_redef,
+                                        MCAsmParser &Parser, MCSymbol *&Symbol,
+                                        const MCExpr *&Value);
 
 } // namespace MCParserUtils
 
diff --git a/llvm/include/llvm/MC/MCSFrame.h b/llvm/include/llvm/MC/MCSFrame.h
index 694aec55aefeb..62740880f5daa 100644
--- a/llvm/include/llvm/MC/MCSFrame.h
+++ b/llvm/include/llvm/MC/MCSFrame.h
@@ -30,7 +30,7 @@ class MCSFrameEmitter {
   // Emit the sframe section.
   //
   // \param Streamer - Emit into this stream.
-  static void emit(MCObjectStreamer &Streamer);
+  LLVM_ABI static void emit(MCObjectStreamer &Streamer);
 
   // Encode the FRE's function offset.
   //
@@ -38,8 +38,9 @@ class MCSFrameEmitter {
   // \param Offset - Offset to encode.
   // \param Out - Destination of the encoding.
   // \param FDEFrag - Frag that specifies the encoding format.
-  static void encodeFuncOffset(MCContext &C, uint64_t Offset,
-                               SmallVectorImpl<char> &Out, MCFragment *FDEFrag);
+  LLVM_ABI static void encodeFuncOffset(MCContext &C, uint64_t Offset,
+                                        SmallVectorImpl<char> &Out,
+                                        MCFragment *FDEFrag);
 };
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
index 3cbca4c46c5de..1ea89df65c596 100644
--- a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
+++ b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
@@ -25,...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/202930


More information about the llvm-commits mailing list