[llvm] 7e928f9 - [llvm] fix missing and incorrect LLVM_ABI annotations (#147399)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 08:54:20 PDT 2025


Author: Andrew Rogers
Date: 2025-07-08T08:54:15-07:00
New Revision: 7e928f9d37788a8143c7704c98133f107612b87d

URL: https://github.com/llvm/llvm-project/commit/7e928f9d37788a8143c7704c98133f107612b87d
DIFF: https://github.com/llvm/llvm-project/commit/7e928f9d37788a8143c7704c98133f107612b87d.diff

LOG: [llvm] fix missing and incorrect LLVM_ABI annotations (#147399)

## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public
interface for export. This patch adds `LLVM_ABI` annotations to some
recently added symbols that were previously missed. It also removes
`LLVM_ABI` from symbols where it is problematic. The LLVM annotation
currently has no meaningful impact on the LLVM build; however, it is a
prerequisite to support an LLVM Windows DLL (shared library) build.

## Overview

These changes were generated automatically using the [Interface
Definition Scanner (IDS)](https://github.com/compnerd/ids) tool,
followed formatting with `git clang-format`.

NOTE: I am using a modified version of IDS with local patches so it
removes unnecessary export annotations. These local IDS changes
generated all of the `LLVM_ABI` deletions in this PR.

## Background

This effort is tracked in #109483. Additional context is provided in
[this
discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307),
and documentation for `LLVM_ABI` and related annotations is found in the
LLVM repo
[here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst).


## Validation

Local builds and tests to validate cross-platform compatibility. This
included llvm, clang, and lldb on the following configurations:

- Windows with MSVC
- Windows with Clang
- Linux with GCC
- Linux with Clang
- Darwin with Clang

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
    llvm/include/llvm/Analysis/IR2Vec.h
    llvm/include/llvm/Analysis/TargetLibraryInfo.h
    llvm/include/llvm/CodeGen/Passes.h
    llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
    llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
    llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h
    llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
    llvm/include/llvm/IR/DebugInfoMetadata.h
    llvm/include/llvm/IR/IRBuilder.h
    llvm/include/llvm/IR/ProfDataUtils.h
    llvm/include/llvm/IR/RuntimeLibcalls.h
    llvm/include/llvm/MC/MCContext.h
    llvm/include/llvm/MC/MCFixup.h
    llvm/include/llvm/MC/MCSection.h
    llvm/include/llvm/MC/MCSectionGOFF.h
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
index 38177491d6b7d..7c6eca5bb8470 100644
--- a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
+++ b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
@@ -45,7 +45,7 @@ class FunctionPropertiesInfo {
   LLVM_ABI static FunctionPropertiesInfo
   getFunctionPropertiesInfo(Function &F, FunctionAnalysisManager &FAM);
 
-  bool operator==(const FunctionPropertiesInfo &FPI) const;
+  LLVM_ABI bool operator==(const FunctionPropertiesInfo &FPI) const;
 
   bool operator!=(const FunctionPropertiesInfo &FPI) const {
     return !(*this == FPI);

diff  --git a/llvm/include/llvm/Analysis/IR2Vec.h b/llvm/include/llvm/Analysis/IR2Vec.h
index ef8f630d7feb1..16fb07bdbbe9f 100644
--- a/llvm/include/llvm/Analysis/IR2Vec.h
+++ b/llvm/include/llvm/Analysis/IR2Vec.h
@@ -123,7 +123,7 @@ struct Embedding {
   LLVM_ABI bool approximatelyEquals(const Embedding &RHS,
                                     double Tolerance = 1e-4) const;
 
-  void print(raw_ostream &OS) const;
+  LLVM_ABI void print(raw_ostream &OS) const;
 };
 
 using InstEmbeddingsMap = DenseMap<const Instruction *, Embedding>;
@@ -272,7 +272,7 @@ class IR2VecVocabPrinterPass : public PassInfoMixin<IR2VecVocabPrinterPass> {
 
 public:
   explicit IR2VecVocabPrinterPass(raw_ostream &OS) : OS(OS) {}
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
+  LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
   static bool isRequired() { return true; }
 };
 

diff  --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
index 58ffac0a6e207..c7bd1618e2f9b 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -136,7 +136,7 @@ class TargetLibraryInfoImpl {
     AMDLIBM      // AMD Math Vector library.
   };
 
-  LLVM_ABI TargetLibraryInfoImpl() = delete;
+  TargetLibraryInfoImpl() = delete;
   LLVM_ABI explicit TargetLibraryInfoImpl(const Triple &T);
 
   // Provide value semantics.

diff  --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index 18df5d657064a..714285eb5d5d4 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -619,7 +619,7 @@ LLVM_ABI FunctionPass *createSelectOptimizePass();
 LLVM_ABI FunctionPass *createCallBrPass();
 
 /// Creates Windows Secure Hot Patch pass. \see WindowsSecureHotPatching.cpp
-ModulePass *createWindowsSecureHotPatchingPass();
+LLVM_ABI ModulePass *createWindowsSecureHotPatchingPass();
 
 /// Lowers KCFI operand bundles for indirect calls.
 LLVM_ABI FunctionPass *createKCFIPass();

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
index def291046c7db..d2f05f19b376c 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
@@ -42,8 +42,8 @@ class DWARFDataExtractor : public DWARFDataExtractorBase<DWARFDataExtractor> {
 
   /// Extracts a value and applies a relocation to the result if
   /// one exists for the given offset.
-  LLVM_ABI uint64_t getRelocatedValueImpl(uint32_t Size, uint64_t *Off,
-                                          uint64_t *SecNdx, Error *Err) const {
+  uint64_t getRelocatedValueImpl(uint32_t Size, uint64_t *Off, uint64_t *SecNdx,
+                                 Error *Err) const {
     if (SecNdx)
       *SecNdx = object::SectionedAddress::UndefSection;
     if (!Section)

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
index 1ad54dfa1a305..c571112344254 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
@@ -79,8 +79,8 @@ class CFIProgram {
   /// to EndOffset upon successful parsing, or indicates the offset
   /// where a problem occurred in case an error is returned.
   template <typename T>
-  LLVM_ABI Error parse(DWARFDataExtractorBase<T> &Data, uint64_t *Offset,
-                       uint64_t EndOffset) {
+  Error parse(DWARFDataExtractorBase<T> &Data, uint64_t *Offset,
+              uint64_t EndOffset) {
     // See DWARF standard v3, section 7.23
     const uint8_t DWARF_CFI_PRIMARY_OPCODE_MASK = 0xc0;
     const uint8_t DWARF_CFI_PRIMARY_OPERAND_MASK = 0x3f;

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h
index 7ef62a6383f9b..52af205257627 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h
@@ -39,26 +39,24 @@ class DWARFDataExtractorBase : public DataExtractor {
                       Other.getAddressSize()) {}
 
   /// Extracts a value and returns it as adjusted by the Relocator
-  LLVM_ABI uint64_t getRelocatedValue(uint32_t Size, uint64_t *Off,
-                                      uint64_t *SectionIndex = nullptr,
-                                      Error *Err = nullptr) const {
+  uint64_t getRelocatedValue(uint32_t Size, uint64_t *Off,
+                             uint64_t *SectionIndex = nullptr,
+                             Error *Err = nullptr) const {
     return static_cast<const Relocator *>(this)->getRelocatedValueImpl(
         Size, Off, SectionIndex, Err);
   }
 
-  LLVM_ABI uint64_t getRelocatedValue(Cursor &C, uint32_t Size,
-                                      uint64_t *SectionIndex = nullptr) const {
+  uint64_t getRelocatedValue(Cursor &C, uint32_t Size,
+                             uint64_t *SectionIndex = nullptr) const {
     return getRelocatedValue(Size, &getOffset(C), SectionIndex, &getError(C));
   }
 
   /// Extracts an address-sized value.
-  LLVM_ABI uint64_t getRelocatedAddress(uint64_t *Off,
-                                        uint64_t *SecIx = nullptr) const {
+  uint64_t getRelocatedAddress(uint64_t *Off, uint64_t *SecIx = nullptr) const {
     return getRelocatedValue(getAddressSize(), Off, SecIx);
   }
 
-  LLVM_ABI uint64_t getRelocatedAddress(Cursor &C,
-                                        uint64_t *SecIx = nullptr) const {
+  uint64_t getRelocatedAddress(Cursor &C, uint64_t *SecIx = nullptr) const {
     return getRelocatedValue(getAddressSize(), &getOffset(C), SecIx,
                              &getError(C));
   }
@@ -68,7 +66,7 @@ class DWARFDataExtractorBase : public DataExtractor {
   /// 64-bit length. Returns the actual length, and the DWARF format which is
   /// encoded in the field. In case of errors, it returns {0, DWARF32} and
   /// leaves the offset unchanged.
-  LLVM_ABI std::pair<uint64_t, dwarf::DwarfFormat>
+  std::pair<uint64_t, dwarf::DwarfFormat>
   getInitialLength(uint64_t *Off, Error *Err = nullptr) const {
     ErrorAsOutParameter ErrAsOut(Err);
     if (Err && *Err)
@@ -100,8 +98,7 @@ class DWARFDataExtractorBase : public DataExtractor {
     return {0, dwarf::DWARF32};
   }
 
-  LLVM_ABI std::pair<uint64_t, dwarf::DwarfFormat>
-  getInitialLength(Cursor &C) const {
+  std::pair<uint64_t, dwarf::DwarfFormat> getInitialLength(Cursor &C) const {
     return getInitialLength(&getOffset(C), &getError(C));
   }
 
@@ -109,9 +106,8 @@ class DWARFDataExtractorBase : public DataExtractor {
   /// There is a DWARF encoding that uses a PC-relative adjustment.
   /// For these values, \p AbsPosOffset is used to fix them, which should
   /// reflect the absolute address of this pointer.
-  LLVM_ABI std::optional<uint64_t>
-  getEncodedPointer(uint64_t *Offset, uint8_t Encoding,
-                    uint64_t PCRelOffset) const {
+  std::optional<uint64_t> getEncodedPointer(uint64_t *Offset, uint8_t Encoding,
+                                            uint64_t PCRelOffset) const {
     if (Encoding == dwarf::DW_EH_PE_omit)
       return std::nullopt;
 

diff  --git a/llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h b/llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
index 898c32aa4b8f2..fbcdd51d7f64e 100644
--- a/llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
+++ b/llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Frontend/OpenMP/OMP.h"
+#include "llvm/Support/Compiler.h"
 
 #include <memory>
 
@@ -44,7 +45,7 @@ namespace llvm::omp {
 ///   }
 /// }
 struct DirectiveNameParser {
-  DirectiveNameParser(SourceLanguage L = SourceLanguage::C);
+  LLVM_ABI DirectiveNameParser(SourceLanguage L = SourceLanguage::C);
 
   struct State {
     Directive Value = Directive::OMPD_unknown;
@@ -62,9 +63,9 @@ struct DirectiveNameParser {
   };
 
   const State *initial() const { return &InitialState; }
-  const State *consume(const State *Current, StringRef Tok) const;
+  LLVM_ABI const State *consume(const State *Current, StringRef Tok) const;
 
-  static SmallVector<StringRef> tokenize(StringRef N);
+  LLVM_ABI static SmallVector<StringRef> tokenize(StringRef N);
 
 private:
   void insertName(StringRef Name, Directive D);

diff  --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index b9eb3851d66c3..9345f95015301 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -870,22 +870,22 @@ class DIBasicType : public DIType {
                    SizeInBits, AlignInBits, Encoding, NumExtraInhabitants,
                    Flags, Storage, ShouldCreate);
   }
-  LLVM_ABI static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
-                                       MDString *Name, uint64_t SizeInBits,
-                                       uint32_t AlignInBits, unsigned Encoding,
-                                       uint32_t NumExtraInhabitants,
-                                       DIFlags Flags, StorageType Storage,
-                                       bool ShouldCreate = true) {
+  static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
+                              MDString *Name, uint64_t SizeInBits,
+                              uint32_t AlignInBits, unsigned Encoding,
+                              uint32_t NumExtraInhabitants, DIFlags Flags,
+                              StorageType Storage, bool ShouldCreate = true) {
     auto *SizeInBitsNode = ConstantAsMetadata::get(
         ConstantInt::get(Type::getInt64Ty(Context), SizeInBits));
     return getImpl(Context, Tag, Name, SizeInBitsNode, AlignInBits, Encoding,
                    NumExtraInhabitants, Flags, Storage, ShouldCreate);
   }
-  static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
-                              MDString *Name, Metadata *SizeInBits,
-                              uint32_t AlignInBits, unsigned Encoding,
-                              uint32_t NumExtraInhabitants, DIFlags Flags,
-                              StorageType Storage, bool ShouldCreate = true);
+  LLVM_ABI static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
+                                       MDString *Name, Metadata *SizeInBits,
+                                       uint32_t AlignInBits, unsigned Encoding,
+                                       uint32_t NumExtraInhabitants,
+                                       DIFlags Flags, StorageType Storage,
+                                       bool ShouldCreate = true);
 
   TempDIBasicType cloneImpl() const {
     return getTemporary(getContext(), getTag(), getRawName(),
@@ -1005,7 +1005,7 @@ class DIFixedPointType : public DIBasicType {
                    SizeInBits, AlignInBits, Encoding, Flags, Kind, Factor,
                    Numerator, Denominator, Storage, ShouldCreate);
   }
-  LLVM_ABI static DIFixedPointType *
+  static DIFixedPointType *
   getImpl(LLVMContext &Context, unsigned Tag, MDString *Name,
           uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding,
           DIFlags Flags, unsigned Kind, int Factor, APInt Numerator,
@@ -1016,7 +1016,7 @@ class DIFixedPointType : public DIBasicType {
                    Flags, Kind, Factor, Numerator, Denominator, Storage,
                    ShouldCreate);
   }
-  static DIFixedPointType *
+  LLVM_ABI static DIFixedPointType *
   getImpl(LLVMContext &Context, unsigned Tag, MDString *Name,
           Metadata *SizeInBits, uint32_t AlignInBits, unsigned Encoding,
           DIFlags Flags, unsigned Kind, int Factor, APInt Numerator,
@@ -1127,23 +1127,23 @@ class DIStringType : public DIType {
                    StringLength, StrLenExp, StrLocationExp, SizeInBitsNode,
                    AlignInBits, Encoding, Storage, ShouldCreate);
   }
-  LLVM_ABI static DIStringType *
-  getImpl(LLVMContext &Context, unsigned Tag, MDString *Name,
-          Metadata *StringLength, Metadata *StrLenExp, Metadata *StrLocationExp,
-          uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding,
-          StorageType Storage, bool ShouldCreate = true) {
+  static DIStringType *getImpl(LLVMContext &Context, unsigned Tag,
+                               MDString *Name, Metadata *StringLength,
+                               Metadata *StrLenExp, Metadata *StrLocationExp,
+                               uint64_t SizeInBits, uint32_t AlignInBits,
+                               unsigned Encoding, StorageType Storage,
+                               bool ShouldCreate = true) {
     auto *SizeInBitsNode = ConstantAsMetadata::get(
         ConstantInt::get(Type::getInt64Ty(Context), SizeInBits));
     return getImpl(Context, Tag, Name, StringLength, StrLenExp, StrLocationExp,
                    SizeInBitsNode, AlignInBits, Encoding, Storage,
                    ShouldCreate);
   }
-  static DIStringType *getImpl(LLVMContext &Context, unsigned Tag,
-                               MDString *Name, Metadata *StringLength,
-                               Metadata *StrLenExp, Metadata *StrLocationExp,
-                               Metadata *SizeInBits, uint32_t AlignInBits,
-                               unsigned Encoding, StorageType Storage,
-                               bool ShouldCreate = true);
+  LLVM_ABI static DIStringType *
+  getImpl(LLVMContext &Context, unsigned Tag, MDString *Name,
+          Metadata *StringLength, Metadata *StrLenExp, Metadata *StrLocationExp,
+          Metadata *SizeInBits, uint32_t AlignInBits, unsigned Encoding,
+          StorageType Storage, bool ShouldCreate = true);
 
   TempDIStringType cloneImpl() const {
     return getTemporary(getContext(), getTag(), getRawName(),

diff  --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 66ab2fa5610f5..7c600e762a451 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -960,7 +960,7 @@ class IRBuilderBase {
                                               const Twine &Name = "");
 
   /// Create a call to llvm.vscale.<Ty>().
-  LLVM_ABI Value *CreateVScale(Type *Ty, const Twine &Name = "") {
+  Value *CreateVScale(Type *Ty, const Twine &Name = "") {
     return CreateIntrinsic(Intrinsic::vscale, {Ty}, {}, {}, Name);
   }
 

diff  --git a/llvm/include/llvm/IR/ProfDataUtils.h b/llvm/include/llvm/IR/ProfDataUtils.h
index bc3b046dadb46..ca56e4aa81575 100644
--- a/llvm/include/llvm/IR/ProfDataUtils.h
+++ b/llvm/include/llvm/IR/ProfDataUtils.h
@@ -22,12 +22,12 @@
 
 namespace llvm {
 struct MDProfLabels {
-  static const char *BranchWeights;
-  static const char *ValueProfile;
-  static const char *FunctionEntryCount;
-  static const char *SyntheticFunctionEntryCount;
-  static const char *ExpectedBranchWeights;
-  static const char *UnknownBranchWeightsMarker;
+  LLVM_ABI static const char *BranchWeights;
+  LLVM_ABI static const char *ValueProfile;
+  LLVM_ABI static const char *FunctionEntryCount;
+  LLVM_ABI static const char *SyntheticFunctionEntryCount;
+  LLVM_ABI static const char *ExpectedBranchWeights;
+  LLVM_ABI static const char *UnknownBranchWeightsMarker;
 };
 
 /// Checks if an Instruction has MD_prof Metadata

diff  --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h
index cd052edff9a25..131aa8bf7faef 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -165,7 +165,7 @@ struct RuntimeLibcallsInfo {
 
   /// Names of concrete implementations of runtime calls. e.g. __ashlsi3 for
   /// SHL_I32
-  static const char *const LibCallImplNames[RTLIB::NumLibcallImpls];
+  LLVM_ABI static const char *const LibCallImplNames[RTLIB::NumLibcallImpls];
 
   /// Map from a concrete LibcallImpl implementation to its RTLIB::Libcall kind.
   static const RTLIB::Libcall ImplToLibcall[RTLIB::NumLibcallImpls];
@@ -195,12 +195,12 @@ struct RuntimeLibcallsInfo {
            (TT.isAndroid() && !TT.isAndroidVersionLT(9));
   }
 
-  void initDefaultLibCallImpls();
+  LLVM_ABI void initDefaultLibCallImpls();
 
   /// Generated by tablegen.
   void setTargetRuntimeLibcallSets(const Triple &TT);
 
-  void initSoftFloatCmpLibcallPredicates();
+  LLVM_ABI void initSoftFloatCmpLibcallPredicates();
 
   /// Set default libcall names. If a target wants to opt-out of a libcall it
   /// should be placed here.

diff  --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index d7b81af4a785a..9f31e821d0923 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -612,12 +612,14 @@ class MCContext {
   getELFUniqueIDForEntsize(StringRef SectionName, unsigned Flags,
                            unsigned EntrySize);
 
-  MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
-                                GOFF::SDAttr SDAttributes);
-  MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
-                                GOFF::EDAttr EDAttributes, MCSection *Parent);
-  MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
-                                GOFF::PRAttr PRAttributes, MCSection *Parent);
+  LLVM_ABI MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
+                                         GOFF::SDAttr SDAttributes);
+  LLVM_ABI MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
+                                         GOFF::EDAttr EDAttributes,
+                                         MCSection *Parent);
+  LLVM_ABI MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
+                                         GOFF::PRAttr PRAttributes,
+                                         MCSection *Parent);
 
   LLVM_ABI MCSectionCOFF *
   getCOFFSection(StringRef Section, unsigned Characteristics,

diff  --git a/llvm/include/llvm/MC/MCFixup.h b/llvm/include/llvm/MC/MCFixup.h
index c1fbe70284919..4002a862e4d79 100644
--- a/llvm/include/llvm/MC/MCFixup.h
+++ b/llvm/include/llvm/MC/MCFixup.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_MC_MCFIXUP_H
 #define LLVM_MC_MCFIXUP_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SMLoc.h"
@@ -121,7 +122,7 @@ class MCFixup {
     }
   }
 
-  SMLoc getLoc() const;
+  LLVM_ABI SMLoc getLoc() const;
 };
 
 namespace mc {

diff  --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index 3abe5e0fe3c6f..e7829d9bf3010 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -386,7 +386,7 @@ class MCEncodedFragment : public MCFragment {
     getContentsForAppending().append(Num, Elt);
     doneAppending();
   }
-  void setContents(ArrayRef<char> Contents);
+  LLVM_ABI void setContents(ArrayRef<char> Contents);
   MutableArrayRef<char> getContents() {
     return MutableArrayRef(getParent()->ContentStorage)
         .slice(ContentStart, ContentEnd - ContentStart);
@@ -399,9 +399,9 @@ class MCEncodedFragment : public MCFragment {
   // Fixup-related functions manage parent's storage using FixupStart and
   // FixupSize.
   void clearFixups() { FixupEnd = FixupStart; }
-  void addFixup(MCFixup Fixup);
-  void appendFixups(ArrayRef<MCFixup> Fixups);
-  void setFixups(ArrayRef<MCFixup> Fixups);
+  LLVM_ABI void addFixup(MCFixup Fixup);
+  LLVM_ABI void appendFixups(ArrayRef<MCFixup> Fixups);
+  LLVM_ABI void setFixups(ArrayRef<MCFixup> Fixups);
   MutableArrayRef<MCFixup> getFixups() {
     return MutableArrayRef(getParent()->FixupStorage)
         .slice(FixupStart, FixupEnd - FixupStart);

diff  --git a/llvm/include/llvm/MC/MCSectionGOFF.h b/llvm/include/llvm/MC/MCSectionGOFF.h
index 1e6a331202f3c..9e3f95e82a14c 100644
--- a/llvm/include/llvm/MC/MCSectionGOFF.h
+++ b/llvm/include/llvm/MC/MCSectionGOFF.h
@@ -18,6 +18,7 @@
 #include "llvm/BinaryFormat/GOFF.h"
 #include "llvm/MC/MCGOFFAttributes.h"
 #include "llvm/MC/MCSection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -25,7 +26,7 @@ namespace llvm {
 
 class MCExpr;
 
-class MCSectionGOFF final : public MCSection {
+class LLVM_ABI MCSectionGOFF final : public MCSection {
   // Parent of this section. Implies that the parent is emitted first.
   MCSectionGOFF *Parent;
 

diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 1c589fb944141..719c0ee136236 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -6352,8 +6352,8 @@ struct AAInvariantLoadPointer : public AbstractAttribute {
   }
 
   /// Create an abstract attribute view for the position \p IRP.
-  static AAInvariantLoadPointer &createForPosition(const IRPosition &IRP,
-                                                   Attributor &A);
+  LLVM_ABI static AAInvariantLoadPointer &
+  createForPosition(const IRPosition &IRP, Attributor &A);
 
   /// Return true if the pointer's contents are known to remain invariant.
   virtual bool isKnownInvariant() const = 0;
@@ -6376,7 +6376,7 @@ struct AAInvariantLoadPointer : public AbstractAttribute {
   }
 
   /// Unique ID (due to the unique address).
-  static const char ID;
+  LLVM_ABI static const char ID;
 };
 
 /// An abstract interface for address space information.


        


More information about the llvm-commits mailing list