[llvm] [llvm] annotate interfaces in FileCheck, FrontEnd, and FuzzMutate libraries for DLL export (PR #141864)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 11:15:07 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-hlsl

Author: Andrew Rogers (andrurogerz)

<details>
<summary>Changes</summary>

## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the `llvm/FileCheck`, `llvm/FrontEnd`,  and `llvm/FuzzMutate  libraries. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build.

## 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).  

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

The following manual adjustments were also applied after running IDS on Linux:
- Add #include "llvm/Support/Compiler.h" where it was not auto-added by IDS due to no pre-existing block of include statements.

## 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

---

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


14 Files Affected:

- (modified) llvm/include/llvm/FileCheck/FileCheck.h (+16-14) 
- (modified) llvm/include/llvm/Frontend/Atomic/Atomic.h (+12-10) 
- (modified) llvm/include/llvm/Frontend/Driver/CodeGenOptions.h (+4-2) 
- (modified) llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h (+6-4) 
- (modified) llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h (+14-11) 
- (modified) llvm/include/llvm/Frontend/Offloading/Utility.h (+16-13) 
- (modified) llvm/include/llvm/Frontend/OpenMP/OMP.h (+12-10) 
- (modified) llvm/include/llvm/Frontend/OpenMP/OMPContext.h (+37-31) 
- (modified) llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h (+333-312) 
- (modified) llvm/include/llvm/FuzzMutate/FuzzerCLI.h (+5-4) 
- (modified) llvm/include/llvm/FuzzMutate/IRMutator.h (+17-16) 
- (modified) llvm/include/llvm/FuzzMutate/OpDescriptor.h (+3-2) 
- (modified) llvm/include/llvm/FuzzMutate/Operations.h (+27-20) 
- (modified) llvm/include/llvm/FuzzMutate/RandomIRBuilder.h (+23-17) 


``````````diff
diff --git a/llvm/include/llvm/FileCheck/FileCheck.h b/llvm/include/llvm/FileCheck/FileCheck.h
index 72d0b91b27ad0..b44ed8ed3f839 100644
--- a/llvm/include/llvm/FileCheck/FileCheck.h
+++ b/llvm/include/llvm/FileCheck/FileCheck.h
@@ -14,6 +14,7 @@
 #define LLVM_FILECHECK_FILECHECK_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/SMLoc.h"
 #include <bitset>
@@ -91,7 +92,7 @@ class FileCheckType {
   operator FileCheckKind() const { return Kind; }
 
   int getCount() const { return Count; }
-  FileCheckType &setCount(int C);
+  LLVM_ABI FileCheckType &setCount(int C);
 
   bool isLiteralMatch() const {
     return Modifiers[FileCheckKindModifier::ModifierLiteral];
@@ -102,10 +103,10 @@ class FileCheckType {
   }
 
   // \returns a description of \p Prefix.
-  std::string getDescription(StringRef Prefix) const;
+  LLVM_ABI std::string getDescription(StringRef Prefix) const;
 
   // \returns a description of \p Modifiers.
-  std::string getModifiersDescription() const;
+  LLVM_ABI std::string getModifiersDescription() const;
 };
 } // namespace Check
 
@@ -167,9 +168,10 @@ struct FileCheckDiag {
   /// A note to replace the one normally indicated by MatchTy, or the empty
   /// string if none.
   std::string Note;
-  FileCheckDiag(const SourceMgr &SM, const Check::FileCheckType &CheckTy,
-                SMLoc CheckLoc, MatchType MatchTy, SMRange InputRange,
-                StringRef Note = "");
+  LLVM_ABI FileCheckDiag(const SourceMgr &SM,
+                         const Check::FileCheckType &CheckTy, SMLoc CheckLoc,
+                         MatchType MatchTy, SMRange InputRange,
+                         StringRef Note = "");
 };
 
 class FileCheckPatternContext;
@@ -183,8 +185,8 @@ class FileCheck {
   std::vector<FileCheckString> CheckStrings;
 
 public:
-  explicit FileCheck(FileCheckRequest Req);
-  ~FileCheck();
+  LLVM_ABI explicit FileCheck(FileCheckRequest Req);
+  LLVM_ABI ~FileCheck();
 
   /// Reads the check file from \p Buffer and records the expected strings it
   /// contains. Errors are reported against \p SM.
@@ -192,24 +194,24 @@ class FileCheck {
   /// If \p ImpPatBufferIDRange, then the range (inclusive start, exclusive end)
   /// of IDs for source buffers added to \p SM for implicit patterns are
   /// recorded in it.  The range is empty if there are none.
-  bool
+  LLVM_ABI bool
   readCheckFile(SourceMgr &SM, StringRef Buffer,
                 std::pair<unsigned, unsigned> *ImpPatBufferIDRange = nullptr);
 
-  bool ValidateCheckPrefixes();
+  LLVM_ABI bool ValidateCheckPrefixes();
 
   /// Canonicalizes whitespaces in the file. Line endings are replaced with
   /// UNIX-style '\n'.
-  StringRef CanonicalizeFile(MemoryBuffer &MB,
-                             SmallVectorImpl<char> &OutputBuffer);
+  LLVM_ABI StringRef CanonicalizeFile(MemoryBuffer &MB,
+                                      SmallVectorImpl<char> &OutputBuffer);
 
   /// Checks the input to FileCheck provided in the \p Buffer against the
   /// expected strings read from the check file and record diagnostics emitted
   /// in \p Diags. Errors are recorded against \p SM.
   ///
   /// \returns false if the input fails to satisfy the checks.
-  bool checkInput(SourceMgr &SM, StringRef Buffer,
-                  std::vector<FileCheckDiag> *Diags = nullptr);
+  LLVM_ABI bool checkInput(SourceMgr &SM, StringRef Buffer,
+                           std::vector<FileCheckDiag> *Diags = nullptr);
 };
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Frontend/Atomic/Atomic.h b/llvm/include/llvm/Frontend/Atomic/Atomic.h
index 0231e01344bfe..8addcd388d734 100644
--- a/llvm/include/llvm/Frontend/Atomic/Atomic.h
+++ b/llvm/include/llvm/Frontend/Atomic/Atomic.h
@@ -11,6 +11,7 @@
 
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AtomicInfo {
@@ -55,13 +56,13 @@ class AtomicInfo {
 
   LLVMContext &getLLVMContext() const { return Builder->getContext(); }
 
-  bool shouldCastToInt(Type *ValTy, bool CmpXchg);
+  LLVM_ABI bool shouldCastToInt(Type *ValTy, bool CmpXchg);
 
-  Value *EmitAtomicLoadOp(AtomicOrdering AO, bool IsVolatile,
-                          bool CmpXchg = false);
+  LLVM_ABI Value *EmitAtomicLoadOp(AtomicOrdering AO, bool IsVolatile,
+                                   bool CmpXchg = false);
 
-  CallInst *EmitAtomicLibcall(StringRef fnName, Type *ResultType,
-                              ArrayRef<Value *> Args);
+  LLVM_ABI CallInst *EmitAtomicLibcall(StringRef fnName, Type *ResultType,
+                                       ArrayRef<Value *> Args);
 
   Value *getAtomicSizeValue() const {
     LLVMContext &ctx = getLLVMContext();
@@ -73,7 +74,7 @@ class AtomicInfo {
                             AtomicSizeInBits / BitsPerByte);
   }
 
-  std::pair<Value *, Value *>
+  LLVM_ABI std::pair<Value *, Value *>
   EmitAtomicCompareExchangeLibcall(Value *ExpectedVal, Value *DesiredVal,
                                    AtomicOrdering Success,
                                    AtomicOrdering Failure);
@@ -86,19 +87,20 @@ class AtomicInfo {
     return castToAtomicIntPointer(getAtomicPointer());
   }
 
-  std::pair<Value *, Value *>
+  LLVM_ABI std::pair<Value *, Value *>
   EmitAtomicCompareExchangeOp(Value *ExpectedVal, Value *DesiredVal,
                               AtomicOrdering Success, AtomicOrdering Failure,
                               bool IsVolatile = false, bool IsWeak = false);
 
-  std::pair<Value *, Value *>
+  LLVM_ABI std::pair<Value *, Value *>
   EmitAtomicCompareExchange(Value *ExpectedVal, Value *DesiredVal,
                             AtomicOrdering Success, AtomicOrdering Failure,
                             bool IsVolatile, bool IsWeak);
 
-  std::pair<LoadInst *, AllocaInst *> EmitAtomicLoadLibcall(AtomicOrdering AO);
+  LLVM_ABI std::pair<LoadInst *, AllocaInst *>
+  EmitAtomicLoadLibcall(AtomicOrdering AO);
 
-  void EmitAtomicStoreLibcall(AtomicOrdering AO, Value *Source);
+  LLVM_ABI void EmitAtomicStoreLibcall(AtomicOrdering AO, Value *Source);
 };
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h b/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
index ee52645f2e51b..e8e70c0e126a9 100644
--- a/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
+++ b/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H
 #define LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Triple;
 class TargetLibraryInfoImpl;
@@ -46,8 +48,8 @@ enum class VectorLibrary {
   AMDLIBM             // AMD vector math library.
 };
 
-TargetLibraryInfoImpl *createTLII(const llvm::Triple &TargetTriple,
-                                  VectorLibrary Veclib);
+LLVM_ABI TargetLibraryInfoImpl *createTLII(const llvm::Triple &TargetTriple,
+                                           VectorLibrary Veclib);
 
 } // end namespace llvm::driver
 
diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
index f9de86b567fea..d2f65a710909f 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
@@ -15,6 +15,7 @@
 #define LLVM_FRONTEND_HLSL_HLSLROOTSIGNATURE_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DXILABI.h"
 #include "llvm/Support/raw_ostream.h"
 #include <variant>
@@ -123,7 +124,7 @@ struct DescriptorTable {
   uint32_t NumClauses = 0;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table);
+LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table);
 
 static const uint32_t NumDescriptorsUnbounded = 0xffffffff;
 static const uint32_t DescriptorTableOffsetAppend = 0xffffffff;
@@ -153,7 +154,8 @@ struct DescriptorTableClause {
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const DescriptorTableClause &Clause);
+LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
+                                 const DescriptorTableClause &Clause);
 
 struct StaticSampler {
   Register Reg;
@@ -179,7 +181,7 @@ using RootElement =
     std::variant<RootFlags, RootConstants, RootDescriptor, DescriptorTable,
                  DescriptorTableClause, StaticSampler>;
 
-void dumpRootElements(raw_ostream &OS, ArrayRef<RootElement> Elements);
+LLVM_ABI void dumpRootElements(raw_ostream &OS, ArrayRef<RootElement> Elements);
 
 class MetadataBuilder {
 public:
@@ -190,7 +192,7 @@ class MetadataBuilder {
   ///
   /// Accumulates the root signature and returns the Metadata node that is just
   /// a list of all the elements
-  MDNode *BuildRootSignature();
+  LLVM_ABI MDNode *BuildRootSignature();
 
 private:
   /// Define the various builders for the different metadata types
diff --git a/llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h b/llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h
index 79309251c3b6b..6b9da06707261 100644
--- a/llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h
+++ b/llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace offloading {
@@ -22,11 +23,10 @@ using EntryArrayTy = std::pair<GlobalVariable *, GlobalVariable *>;
 /// \param Suffix An optional suffix appended to the emitted symbols.
 /// \param Relocatable Indicate if we need to change the offloading section to
 /// create a relocatable object.
-llvm::Error wrapOpenMPBinaries(llvm::Module &M,
-                               llvm::ArrayRef<llvm::ArrayRef<char>> Images,
-                               EntryArrayTy EntryArray,
-                               llvm::StringRef Suffix = "",
-                               bool Relocatable = false);
+LLVM_ABI llvm::Error
+wrapOpenMPBinaries(llvm::Module &M, llvm::ArrayRef<llvm::ArrayRef<char>> Images,
+                   EntryArrayTy EntryArray, llvm::StringRef Suffix = "",
+                   bool Relocatable = false);
 
 /// Wraps the input fatbinary image into the module \p M as global symbols and
 /// registers the images with the CUDA runtime.
@@ -35,9 +35,11 @@ llvm::Error wrapOpenMPBinaries(llvm::Module &M,
 /// \param Suffix An optional suffix appended to the emitted symbols.
 /// \param EmitSurfacesAndTextures Whether to emit surface and textures
 /// registration code. It defaults to false.
-llvm::Error wrapCudaBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
-                           EntryArrayTy EntryArray, llvm::StringRef Suffix = "",
-                           bool EmitSurfacesAndTextures = true);
+LLVM_ABI llvm::Error wrapCudaBinary(llvm::Module &M,
+                                    llvm::ArrayRef<char> Images,
+                                    EntryArrayTy EntryArray,
+                                    llvm::StringRef Suffix = "",
+                                    bool EmitSurfacesAndTextures = true);
 
 /// Wraps the input bundled image into the module \p M as global symbols and
 /// registers the images with the HIP runtime.
@@ -46,9 +48,10 @@ llvm::Error wrapCudaBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
 /// \param Suffix An optional suffix appended to the emitted symbols.
 /// \param EmitSurfacesAndTextures Whether to emit surface and textures
 /// registration code. It defaults to false.
-llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
-                          EntryArrayTy EntryArray, llvm::StringRef Suffix = "",
-                          bool EmitSurfacesAndTextures = true);
+LLVM_ABI llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images,
+                                   EntryArrayTy EntryArray,
+                                   llvm::StringRef Suffix = "",
+                                   bool EmitSurfacesAndTextures = true);
 } // namespace offloading
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Frontend/Offloading/Utility.h b/llvm/include/llvm/Frontend/Offloading/Utility.h
index 7b717a4733b79..f8a2b1237b5e1 100644
--- a/llvm/include/llvm/Frontend/Offloading/Utility.h
+++ b/llvm/include/llvm/Frontend/Offloading/Utility.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_FRONTEND_OFFLOADING_UTILITY_H
 #define LLVM_FRONTEND_OFFLOADING_UTILITY_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 
@@ -67,7 +68,7 @@ enum OffloadEntryKindFlag : uint32_t {
 
 /// Returns the type of the offloading entry we use to store kernels and
 /// globals that will be registered with the offloading runtime.
-StructType *getEntryTy(Module &M);
+LLVM_ABI StructType *getEntryTy(Module &M);
 
 /// Create an offloading section struct used to register this global at
 /// runtime.
@@ -81,22 +82,23 @@ StructType *getEntryTy(Module &M);
 /// \param Data Extra data storage associated with the entry.
 /// \param SectionName The section this entry will be placed at.
 /// \param AuxAddr An extra pointer if needed.
-void emitOffloadingEntry(Module &M, object::OffloadKind Kind, Constant *Addr,
-                         StringRef Name, uint64_t Size, uint32_t Flags,
-                         uint64_t Data, Constant *AuxAddr = nullptr,
-                         StringRef SectionName = "llvm_offload_entries");
+LLVM_ABI void
+emitOffloadingEntry(Module &M, object::OffloadKind Kind, Constant *Addr,
+                    StringRef Name, uint64_t Size, uint32_t Flags,
+                    uint64_t Data, Constant *AuxAddr = nullptr,
+                    StringRef SectionName = "llvm_offload_entries");
 
 /// Create a constant struct initializer used to register this global at
 /// runtime.
 /// \return the constant struct and the global variable holding the symbol name.
-std::pair<Constant *, GlobalVariable *>
+LLVM_ABI std::pair<Constant *, GlobalVariable *>
 getOffloadingEntryInitializer(Module &M, object::OffloadKind Kind,
                               Constant *Addr, StringRef Name, uint64_t Size,
                               uint32_t Flags, uint64_t Data, Constant *AuxAddr);
 
 /// Creates a pair of globals used to iterate the array of offloading entries by
 /// accessing the section variables provided by the linker.
-std::pair<GlobalVariable *, GlobalVariable *>
+LLVM_ABI std::pair<GlobalVariable *, GlobalVariable *>
 getOffloadEntryArray(Module &M, StringRef SectionName = "llvm_offload_entries");
 
 namespace amdgpu {
@@ -109,8 +111,8 @@ namespace amdgpu {
 /// and is compatible with either '+' or '-'. The HSA runtime returns this
 /// information using the target-id, while we use the ELF header to determine
 /// these features.
-bool isImageCompatibleWithEnv(StringRef ImageArch, uint32_t ImageFlags,
-                              StringRef EnvTargetID);
+LLVM_ABI bool isImageCompatibleWithEnv(StringRef ImageArch, uint32_t ImageFlags,
+                                       StringRef EnvTargetID);
 
 /// Struct for holding metadata related to AMDGPU kernels, for more information
 /// about the metadata and its meaning see:
@@ -149,15 +151,16 @@ struct AMDGPUKernelMetaData {
 
 /// Reads AMDGPU specific metadata from the ELF file and propagates the
 /// KernelInfoMap.
-Error getAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
-                                 StringMap<AMDGPUKernelMetaData> &KernelInfoMap,
-                                 uint16_t &ELFABIVersion);
+LLVM_ABI Error getAMDGPUMetaDataFromImage(
+    MemoryBufferRef MemBuffer, StringMap<AMDGPUKernelMetaData> &KernelInfoMap,
+    uint16_t &ELFABIVersion);
 } // namespace amdgpu
 
 namespace intel {
 /// Containerizes an offloading binary into the ELF binary format expected by
 /// the Intel runtime offload plugin.
-Error containerizeOpenMPSPIRVImage(std::unique_ptr<MemoryBuffer> &Binary);
+LLVM_ABI Error
+containerizeOpenMPSPIRVImage(std::unique_ptr<MemoryBuffer> &Binary);
 } // namespace intel
 } // namespace offloading
 } // namespace llvm
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.h b/llvm/include/llvm/Frontend/OpenMP/OMP.h
index c3381705093ad..35dafc6d246f0 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.h
@@ -14,23 +14,24 @@
 #define LLVM_FRONTEND_OPENMP_OMP_H
 
 #include "llvm/Frontend/OpenMP/OMP.h.inc"
+#include "llvm/Support/Compiler.h"
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 
 namespace llvm::omp {
-ArrayRef<Directive> getLeafConstructs(Directive D);
-ArrayRef<Directive> getLeafConstructsOrSelf(Directive D);
+LLVM_ABI ArrayRef<Directive> getLeafConstructs(Directive D);
+LLVM_ABI ArrayRef<Directive> getLeafConstructsOrSelf(Directive D);
 
-ArrayRef<Directive>
+LLVM_ABI ArrayRef<Directive>
 getLeafOrCompositeConstructs(Directive D, SmallVectorImpl<Directive> &Output);
 
-Directive getCompoundConstruct(ArrayRef<Directive> Parts);
+LLVM_ABI Directive getCompoundConstruct(ArrayRef<Directive> Parts);
 
-bool isLeafConstruct(Directive D);
-bool isCompositeConstruct(Directive D);
-bool isCombinedConstruct(Directive D);
+LLVM_ABI bool isLeafConstruct(Directive D);
+LLVM_ABI bool isCompositeConstruct(Directive D);
+LLVM_ABI bool isCombinedConstruct(Directive D);
 
 /// Can clause C have an iterator-modifier.
 static constexpr inline bool canHaveIterator(Clause C) {
@@ -48,14 +49,15 @@ static constexpr inline bool canHaveIterator(Clause C) {
 }
 
 static constexpr unsigned FallbackVersion = 52;
-ArrayRef<unsigned> getOpenMPVersions();
+LLVM_ABI ArrayRef<unsigned> getOpenMPVersions();
 
 /// Create a nicer version of a function name for humans to look at.
-std::string prettifyFunctionName(StringRef FunctionName);
+LLVM_ABI std::string prettifyFunctionName(StringRef FunctionName);
 
 /// Deconstruct an OpenMP kernel name into the parent function name and the line
 /// number.
-std::string deconstructOpenMPKernelName(StringRef KernelName, unsigned &LineNo);
+LLVM_ABI std::string deconstructOpenMPKernelName(StringRef KernelName,
+                                                 unsigned &LineNo);
 
 } // namespace llvm::omp
 
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
index 9942cbd08aa43..e6c1b4f1f224a 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/Frontend/OpenMP/OMPConstants.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Triple;
@@ -49,69 +50,73 @@ enum class TraitProperty {
 };
 
 /// Parse \p Str and return the trait set it matches or TraitSet::invalid.
-TraitSet getOpenMPContextTraitSetKind(StringRef Str);
+LLVM_ABI TraitSet getOpenMPContextTraitSetKind(StringRef Str);
 
 /// Return the trait set for which \p Selector is a selector.
-TraitSet getOpenMPContextTraitSetForSelector(TraitSelector Selector);
+LLVM_ABI TraitSet getOpenMPContextTraitSetForSelector(TraitSelector Selector);
 
 /// Return the trait set for which \p Property is a property.
-TraitSet getOpenMPContextTraitSetForProperty(TraitProperty Property);
+LLVM_ABI TraitSet getOpenMPContextTraitSetForProperty(TraitProperty Property);
 
 /// Return a textual representation of the trait set \p Kind.
-StringRef getOpenMPContextTraitSetName(TraitSet Kind);
+LLVM_ABI StringRef getOpenMPContextTraitSetName(TraitSet Kind);
 
 /// Parse \p Str and return the trait set it matches or
 /// TraitSelector::invalid.
-TraitSelector getOpenMPContextTraitSelectorKind(StringRef Str, TraitSet Set);
+LLVM_ABI TraitSelector getOpenMPContextTraitSelectorKind(StringRef Str,
+                                                         TraitSet Set);
 
 /// Return the trait selector for which \p Property is a property.
-TraitSelector getOpenMPContextTraitSelectorForProperty(TraitProperty Property);
+LLVM_ABI TraitSelector
+getOpenMPContextTraitSelectorForProperty(TraitProperty Property);
 
 /// Return a textual representation of the trait selector \p Kind.
-StringRef getOpenMPContextTraitSelectorName(TraitSelector Kind);
+LLVM_ABI StringRef getOpenMPContextTraitSelectorName(TraitSelector Kind);
 
 /// Parse \p Str and return the trait property it matches in the set \p Set and
 /// selector \p Selector or TraitProperty::invalid.
-TraitProperty getOpenMPContextTraitPro...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list