[llvm] [Support] Add clang tooling generated explicit visibility macros (PR #113097)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 20 10:54:14 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Thomas Fransham (fsfod)
<details>
<summary>Changes</summary>
These will be needed to export symbols from llvm shared library on windows without
having to export every symbol and running in to the 65k symbol limit of DLLs.
If there are any files or classes you think shouldn't exported i can exclude them and regenerate.
I also skipped running clang-format for now to make diffs easier to read.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.
---
Patch is 250.08 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/113097.diff
129 Files Affected:
- (modified) llvm/include/llvm/Support/AMDGPUMetadata.h (+3-2)
- (modified) llvm/include/llvm/Support/ARMAttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/ARMBuildAttributes.h (+2-1)
- (modified) llvm/include/llvm/Support/ARMWinEH.h (+2-1)
- (modified) llvm/include/llvm/Support/Allocator.h (+1-1)
- (modified) llvm/include/llvm/Support/Atomic.h (+3-2)
- (modified) llvm/include/llvm/Support/BalancedPartitioning.h (+4-3)
- (modified) llvm/include/llvm/Support/Base64.h (+2-1)
- (modified) llvm/include/llvm/Support/BinaryStream.h (+3-2)
- (modified) llvm/include/llvm/Support/BinaryStreamError.h (+2-1)
- (modified) llvm/include/llvm/Support/BinaryStreamReader.h (+2-1)
- (modified) llvm/include/llvm/Support/BinaryStreamRef.h (+3-2)
- (modified) llvm/include/llvm/Support/BinaryStreamWriter.h (+2-1)
- (modified) llvm/include/llvm/Support/BlockFrequency.h (+3-2)
- (modified) llvm/include/llvm/Support/BranchProbability.h (+2-1)
- (modified) llvm/include/llvm/Support/BuryPointer.h (+2-1)
- (modified) llvm/include/llvm/Support/COM.h (+2-1)
- (modified) llvm/include/llvm/Support/CRC.h (+4-3)
- (modified) llvm/include/llvm/Support/CSKYAttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/CSKYAttributes.h (+2-1)
- (modified) llvm/include/llvm/Support/CachePruning.h (+3-2)
- (modified) llvm/include/llvm/Support/Caching.h (+2-1)
- (modified) llvm/include/llvm/Support/Chrono.h (+10-10)
- (modified) llvm/include/llvm/Support/CodeGenCoverage.h (+2-1)
- (modified) llvm/include/llvm/Support/CommandLine.h (+66-65)
- (modified) llvm/include/llvm/Support/Compression.h (+14-13)
- (modified) llvm/include/llvm/Support/ConvertEBCDIC.h (+3-2)
- (modified) llvm/include/llvm/Support/ConvertUTF.h (+27-26)
- (modified) llvm/include/llvm/Support/CrashRecoveryContext.h (+3-2)
- (modified) llvm/include/llvm/Support/DJB.h (+2-1)
- (modified) llvm/include/llvm/Support/DataExtractor.h (+2-1)
- (modified) llvm/include/llvm/Support/Debug.h (+7-6)
- (modified) llvm/include/llvm/Support/DebugCounter.h (+3-2)
- (modified) llvm/include/llvm/Support/DivisionByConstantInfo.h (+3-2)
- (modified) llvm/include/llvm/Support/DynamicLibrary.h (+2-1)
- (modified) llvm/include/llvm/Support/ELFAttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/ELFAttributes.h (+3-2)
- (modified) llvm/include/llvm/Support/Errno.h (+3-2)
- (modified) llvm/include/llvm/Support/Error.h (+15-15)
- (modified) llvm/include/llvm/Support/ErrorHandling.h (+10-10)
- (modified) llvm/include/llvm/Support/ExponentialBackoff.h (+2-1)
- (modified) llvm/include/llvm/Support/ExtensibleRTTI.h (+2-1)
- (modified) llvm/include/llvm/Support/FileCollector.h (+4-3)
- (modified) llvm/include/llvm/Support/FileOutputBuffer.h (+2-1)
- (modified) llvm/include/llvm/Support/FileSystem.h (+81-80)
- (modified) llvm/include/llvm/Support/FileUtilities.h (+3-2)
- (modified) llvm/include/llvm/Support/Format.h (+2-1)
- (modified) llvm/include/llvm/Support/FormatVariadic.h (+2-1)
- (modified) llvm/include/llvm/Support/FormatVariadicDetails.h (+3-2)
- (modified) llvm/include/llvm/Support/FormattedStream.h (+5-4)
- (modified) llvm/include/llvm/Support/GlobPattern.h (+3-2)
- (modified) llvm/include/llvm/Support/GraphWriter.h (+5-4)
- (modified) llvm/include/llvm/Support/HexagonAttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/HexagonAttributes.h (+2-1)
- (modified) llvm/include/llvm/Support/InitLLVM.h (+2-1)
- (modified) llvm/include/llvm/Support/InstructionCost.h (+2-1)
- (modified) llvm/include/llvm/Support/JSON.h (+15-15)
- (modified) llvm/include/llvm/Support/KnownBits.h (+2-1)
- (modified) llvm/include/llvm/Support/LEB128.h (+3-2)
- (modified) llvm/include/llvm/Support/LineIterator.h (+2-1)
- (modified) llvm/include/llvm/Support/Locale.h (+3-2)
- (modified) llvm/include/llvm/Support/LockFileManager.h (+2-1)
- (modified) llvm/include/llvm/Support/MD5.h (+3-2)
- (modified) llvm/include/llvm/Support/MSP430AttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/MSP430Attributes.h (+2-1)
- (modified) llvm/include/llvm/Support/ManagedStatic.h (+3-2)
- (modified) llvm/include/llvm/Support/MathExtras.h (+1-1)
- (modified) llvm/include/llvm/Support/MemAlloc.h (+2-2)
- (modified) llvm/include/llvm/Support/Memory.h (+4-3)
- (modified) llvm/include/llvm/Support/MemoryBuffer.h (+4-3)
- (modified) llvm/include/llvm/Support/MemoryBufferRef.h (+2-1)
- (modified) llvm/include/llvm/Support/ModRef.h (+3-2)
- (modified) llvm/include/llvm/Support/NativeFormatting.h (+11-10)
- (modified) llvm/include/llvm/Support/OptimizedStructLayout.h (+3-2)
- (modified) llvm/include/llvm/Support/OptionStrCmp.h (+3-2)
- (modified) llvm/include/llvm/Support/PGOOptions.h (+2-1)
- (modified) llvm/include/llvm/Support/Parallel.h (+6-5)
- (modified) llvm/include/llvm/Support/Path.h (+47-46)
- (modified) llvm/include/llvm/Support/PluginLoader.h (+2-1)
- (modified) llvm/include/llvm/Support/PrettyStackTrace.h (+11-11)
- (modified) llvm/include/llvm/Support/Process.h (+2-1)
- (modified) llvm/include/llvm/Support/Program.h (+15-14)
- (modified) llvm/include/llvm/Support/RISCVAttributeParser.h (+2-1)
- (modified) llvm/include/llvm/Support/RISCVAttributes.h (+2-1)
- (modified) llvm/include/llvm/Support/RISCVISAUtils.h (+2-1)
- (modified) llvm/include/llvm/Support/RandomNumberGenerator.h (+2-2)
- (modified) llvm/include/llvm/Support/Recycler.h (+2-1)
- (modified) llvm/include/llvm/Support/Regex.h (+2-1)
- (modified) llvm/include/llvm/Support/SHA1.h (+2-1)
- (modified) llvm/include/llvm/Support/SHA256.h (+2-1)
- (modified) llvm/include/llvm/Support/SMTAPI.h (+6-5)
- (modified) llvm/include/llvm/Support/ScaledNumber.h (+6-5)
- (modified) llvm/include/llvm/Support/ScopedPrinter.h (+5-4)
- (modified) llvm/include/llvm/Support/Signals.h (+16-15)
- (modified) llvm/include/llvm/Support/Signposts.h (+2-1)
- (modified) llvm/include/llvm/Support/SipHash.h (+4-3)
- (modified) llvm/include/llvm/Support/SmallVectorMemoryBuffer.h (+2-1)
- (modified) llvm/include/llvm/Support/SourceMgr.h (+5-4)
- (modified) llvm/include/llvm/Support/SpecialCaseList.h (+3-2)
- (modified) llvm/include/llvm/Support/StringSaver.h (+3-2)
- (modified) llvm/include/llvm/Support/SuffixTree.h (+3-2)
- (modified) llvm/include/llvm/Support/SuffixTreeNode.h (+4-3)
- (modified) llvm/include/llvm/Support/SystemUtils.h (+2-1)
- (modified) llvm/include/llvm/Support/TarWriter.h (+2-1)
- (modified) llvm/include/llvm/Support/ThreadPool.h (+4-3)
- (modified) llvm/include/llvm/Support/Threading.h (+10-10)
- (modified) llvm/include/llvm/Support/TimeProfiler.h (+15-14)
- (modified) llvm/include/llvm/Support/Timer.h (+6-5)
- (modified) llvm/include/llvm/Support/ToolOutputFile.h (+3-2)
- (modified) llvm/include/llvm/Support/TypeSize.h (+3-2)
- (modified) llvm/include/llvm/Support/Unicode.h (+8-7)
- (modified) llvm/include/llvm/Support/Valgrind.h (+3-2)
- (modified) llvm/include/llvm/Support/VersionTuple.h (+3-2)
- (modified) llvm/include/llvm/Support/VirtualFileSystem.h (+19-18)
- (modified) llvm/include/llvm/Support/Watchdog.h (+1-1)
- (modified) llvm/include/llvm/Support/Windows/WindowsSupport.h (+6-6)
- (modified) llvm/include/llvm/Support/WindowsError.h (+3-2)
- (modified) llvm/include/llvm/Support/WithColor.h (+2-2)
- (modified) llvm/include/llvm/Support/YAMLParser.h (+15-14)
- (modified) llvm/include/llvm/Support/YAMLTraits.h (+22-21)
- (modified) llvm/include/llvm/Support/circular_raw_ostream.h (+2-1)
- (modified) llvm/include/llvm/Support/raw_os_ostream.h (+2-1)
- (modified) llvm/include/llvm/Support/raw_ostream.h (+15-14)
- (modified) llvm/include/llvm/Support/raw_socket_stream.h (+4-3)
- (modified) llvm/include/llvm/Support/thread.h (+7-6)
- (modified) llvm/include/llvm/Support/xxhash.h (+5-4)
- (modified) llvm/lib/Support/CommandLine.cpp (+19-18)
- (modified) llvm/lib/Support/Debug.cpp (+3-2)
- (modified) llvm/lib/Support/SmallVector.cpp (+3-2)
``````````diff
diff --git a/llvm/include/llvm/Support/AMDGPUMetadata.h b/llvm/include/llvm/Support/AMDGPUMetadata.h
index 76ac7ab74a32e8..990c825ae68751 100644
--- a/llvm/include/llvm/Support/AMDGPUMetadata.h
+++ b/llvm/include/llvm/Support/AMDGPUMetadata.h
@@ -16,6 +16,7 @@
#define LLVM_SUPPORT_AMDGPUMETADATA_H
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
#include <string>
#include <system_error>
@@ -447,10 +448,10 @@ struct Metadata final {
};
/// Converts \p String to \p HSAMetadata.
-std::error_code fromString(StringRef String, Metadata &HSAMetadata);
+LLVM_ABI std::error_code fromString(StringRef String, Metadata &HSAMetadata);
/// Converts \p HSAMetadata to \p String.
-std::error_code toString(Metadata HSAMetadata, std::string &String);
+LLVM_ABI std::error_code toString(Metadata HSAMetadata, std::string &String);
//===----------------------------------------------------------------------===//
// HSA metadata for v3 code object.
diff --git a/llvm/include/llvm/Support/ARMAttributeParser.h b/llvm/include/llvm/Support/ARMAttributeParser.h
index d1d953120ae7ed..da0884d823ffcb 100644
--- a/llvm/include/llvm/Support/ARMAttributeParser.h
+++ b/llvm/include/llvm/Support/ARMAttributeParser.h
@@ -12,13 +12,14 @@
#include "ARMBuildAttributes.h"
#include "ELFAttributeParser.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
class ScopedPrinter;
-class ARMAttributeParser : public ELFAttributeParser {
+class LLVM_ABI ARMAttributeParser : public ELFAttributeParser {
struct DisplayHandler {
ARMBuildAttrs::AttrType attribute;
Error (ARMAttributeParser::*routine)(ARMBuildAttrs::AttrType);
diff --git a/llvm/include/llvm/Support/ARMBuildAttributes.h b/llvm/include/llvm/Support/ARMBuildAttributes.h
index 35f8992ca93296..68acf30e52f3ec 100644
--- a/llvm/include/llvm/Support/ARMBuildAttributes.h
+++ b/llvm/include/llvm/Support/ARMBuildAttributes.h
@@ -18,12 +18,13 @@
#ifndef LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
#define LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ELFAttributes.h"
namespace llvm {
namespace ARMBuildAttrs {
-const TagNameMap &getARMAttributeTags();
+LLVM_ABI const TagNameMap &getARMAttributeTags();
enum SpecialAttr {
// This is for the .cpu asm attr. It translates into one or more
diff --git a/llvm/include/llvm/Support/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
index b6710cca95650d..3c952bcae5f027 100644
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -10,6 +10,7 @@
#define LLVM_SUPPORT_ARMWINEH_H
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
namespace llvm {
@@ -205,7 +206,7 @@ inline uint16_t StackAdjustment(const RuntimeFunction &RF) {
/// SavedRegisterMask - Utility function to calculate the set of saved general
/// purpose (r0-r15) and VFP (d0-d31) registers.
-std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
+LLVM_ABI std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
bool Prologue = true);
/// RuntimeFunctionARM64 - An entry in the table of procedure data (.pdata)
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index 568f0d34032fa2..36561cf5d5a93d 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -36,7 +36,7 @@ namespace detail {
// We call out to an external function to actually print the message as the
// printing code uses Allocator.h in its implementation.
-void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
+LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
size_t TotalMemory);
} // end namespace detail
diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h
index a8445fddc1a855..43df01462b59c3 100644
--- a/llvm/include/llvm/Support/Atomic.h
+++ b/llvm/include/llvm/Support/Atomic.h
@@ -17,6 +17,7 @@
#ifndef LLVM_SUPPORT_ATOMIC_H
#define LLVM_SUPPORT_ATOMIC_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
// Windows will at times define MemoryFence.
@@ -26,14 +27,14 @@
namespace llvm {
namespace sys {
- void MemoryFence();
+ LLVM_ABI void MemoryFence();
#ifdef _MSC_VER
typedef long cas_flag;
#else
typedef uint32_t cas_flag;
#endif
- cas_flag CompareAndSwap(volatile cas_flag* ptr,
+ LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag* ptr,
cas_flag new_value,
cas_flag old_value);
}
diff --git a/llvm/include/llvm/Support/BalancedPartitioning.h b/llvm/include/llvm/Support/BalancedPartitioning.h
index 539d157343fbe3..b1b120787516e8 100644
--- a/llvm/include/llvm/Support/BalancedPartitioning.h
+++ b/llvm/include/llvm/Support/BalancedPartitioning.h
@@ -41,6 +41,7 @@
#include "raw_ostream.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
#include <atomic>
#include <condition_variable>
@@ -53,7 +54,7 @@ namespace llvm {
class ThreadPoolInterface;
/// A function with a set of utility nodes where it is beneficial to order two
/// functions close together if they have similar utility nodes
-class BPFunctionNode {
+class LLVM_ABI BPFunctionNode {
friend class BalancedPartitioning;
public:
@@ -97,7 +98,7 @@ struct BalancedPartitioningConfig {
unsigned TaskSplitDepth = 9;
};
-class BalancedPartitioning {
+class LLVM_ABI BalancedPartitioning {
public:
BalancedPartitioning(const BalancedPartitioningConfig &Config);
@@ -114,7 +115,7 @@ class BalancedPartitioning {
/// wait(). BalancedPartitioning recursively spawns new threads inside other
/// threads, so we need to track how many active threads that could spawn more
/// threads.
- struct BPThreadPool {
+ struct LLVM_ABI BPThreadPool {
ThreadPoolInterface &TheThreadPool;
std::mutex mtx;
std::condition_variable cv;
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 3d96884749b32f..997e8c0b7124e1 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -13,6 +13,7 @@
#ifndef LLVM_SUPPORT_BASE64_H
#define LLVM_SUPPORT_BASE64_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <string>
@@ -54,7 +55,7 @@ template <class InputBytes> std::string encodeBase64(InputBytes const &Bytes) {
return Buffer;
}
-llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
+LLVM_ABI llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
} // end namespace llvm
diff --git a/llvm/include/llvm/Support/BinaryStream.h b/llvm/include/llvm/Support/BinaryStream.h
index 8fba5ee9b0b368..1cb783207a23cb 100644
--- a/llvm/include/llvm/Support/BinaryStream.h
+++ b/llvm/include/llvm/Support/BinaryStream.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
@@ -31,7 +32,7 @@ enum BinaryStreamFlags {
/// single contiguous buffer (or even in memory at all), in such cases a it may
/// be necessary for an implementation to cache such a buffer so that it can
/// return it.
-class BinaryStream {
+class LLVM_ABI BinaryStream {
public:
virtual ~BinaryStream() = default;
@@ -69,7 +70,7 @@ class BinaryStream {
/// buffer to the stream's backing store. Streams are assumed to be buffered
/// so that to be portable it is necessary to call commit() on the stream when
/// all data has been written.
-class WritableBinaryStream : public BinaryStream {
+class LLVM_ABI WritableBinaryStream : public BinaryStream {
public:
~WritableBinaryStream() override = default;
diff --git a/llvm/include/llvm/Support/BinaryStreamError.h b/llvm/include/llvm/Support/BinaryStreamError.h
index cf6e034ffd2ceb..8a45f7bbd52cce 100644
--- a/llvm/include/llvm/Support/BinaryStreamError.h
+++ b/llvm/include/llvm/Support/BinaryStreamError.h
@@ -10,6 +10,7 @@
#define LLVM_SUPPORT_BINARYSTREAMERROR_H
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <string>
@@ -24,7 +25,7 @@ enum class stream_error_code {
};
/// Base class for errors originating when parsing raw PDB files
-class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
+class LLVM_ABI BinaryStreamError : public ErrorInfo<BinaryStreamError> {
public:
static char ID;
explicit BinaryStreamError(stream_error_code C);
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
index ca99388c5d03af..e61349d841cdb9 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -14,6 +14,7 @@
#include "llvm/Support/Alignment.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
@@ -26,7 +27,7 @@ namespace llvm {
/// null-terminated strings, integers in various flavors of endianness, etc.
/// Can be subclassed to provide reading of custom datatypes, although no
/// are overridable.
-class BinaryStreamReader {
+class LLVM_ABI BinaryStreamReader {
public:
BinaryStreamReader() = default;
explicit BinaryStreamReader(BinaryStreamRef Ref);
diff --git a/llvm/include/llvm/Support/BinaryStreamRef.h b/llvm/include/llvm/Support/BinaryStreamRef.h
index fdc46f5fd56057..351c3958aee98c 100644
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/BinaryStream.h"
#include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <memory>
@@ -150,7 +151,7 @@ template <class RefType, class StreamType> class BinaryStreamRefBase {
/// general, you should not pass around pointers or references to BinaryStreams
/// and use inheritance to achieve polymorphism. Instead, you should pass
/// around BinaryStreamRefs by value and achieve polymorphism that way.
-class BinaryStreamRef
+class LLVM_ABI BinaryStreamRef
: public BinaryStreamRefBase<BinaryStreamRef, BinaryStream> {
friend BinaryStreamRefBase<BinaryStreamRef, BinaryStream>;
friend class WritableBinaryStreamRef;
@@ -214,7 +215,7 @@ struct BinarySubstreamRef {
bool empty() const { return size() == 0; }
};
-class WritableBinaryStreamRef
+class LLVM_ABI WritableBinaryStreamRef
: public BinaryStreamRefBase<WritableBinaryStreamRef,
WritableBinaryStream> {
friend BinaryStreamRefBase<WritableBinaryStreamRef, WritableBinaryStream>;
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
index bc1d7949841d6f..f5102ef1931014 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -14,6 +14,7 @@
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamError.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include <cstdint>
@@ -27,7 +28,7 @@ namespace llvm {
/// such as null-terminated strings, integers in various flavors of endianness,
/// etc. Can be subclassed to provide reading and writing of custom datatypes,
/// although no methods are overridable.
-class BinaryStreamWriter {
+class LLVM_ABI BinaryStreamWriter {
public:
BinaryStreamWriter() = default;
explicit BinaryStreamWriter(WritableBinaryStreamRef Ref);
diff --git a/llvm/include/llvm/Support/BlockFrequency.h b/llvm/include/llvm/Support/BlockFrequency.h
index aeab99615a951a..4f630d28f72d63 100644
--- a/llvm/include/llvm/Support/BlockFrequency.h
+++ b/llvm/include/llvm/Support/BlockFrequency.h
@@ -13,6 +13,7 @@
#ifndef LLVM_SUPPORT_BLOCKFREQUENCY_H
#define LLVM_SUPPORT_BLOCKFREQUENCY_H
+#include "llvm/Support/Compiler.h"
#include <cassert>
#include <cstdint>
#include <optional>
@@ -23,7 +24,7 @@ class raw_ostream;
class BranchProbability;
// This class represents Block Frequency as a 64-bit value.
-class BlockFrequency {
+class LLVM_ABI BlockFrequency {
uint64_t Frequency;
public:
@@ -120,7 +121,7 @@ class BlockFrequency {
}
};
-void printRelativeBlockFreq(raw_ostream &OS, BlockFrequency EntryFreq,
+LLVM_ABI void printRelativeBlockFreq(raw_ostream &OS, BlockFrequency EntryFreq,
BlockFrequency Freq);
} // namespace llvm
diff --git a/llvm/include/llvm/Support/BranchProbability.h b/llvm/include/llvm/Support/BranchProbability.h
index 79d70cf611d415..4b48ce22ada14e 100644
--- a/llvm/include/llvm/Support/BranchProbability.h
+++ b/llvm/include/llvm/Support/BranchProbability.h
@@ -13,6 +13,7 @@
#ifndef LLVM_SUPPORT_BRANCHPROBABILITY_H
#define LLVM_SUPPORT_BRANCHPROBABILITY_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
#include <algorithm>
#include <cassert>
@@ -27,7 +28,7 @@ class raw_ostream;
// no greater than 1. It uses a fixed-point-like implementation, in which the
// denominator is always a constant value (here we use 1<<31 for maximum
// precision).
-class BranchProbability {
+class LLVM_ABI BranchProbability {
// Numerator
uint32_t N;
diff --git a/llvm/include/llvm/Support/BuryPointer.h b/llvm/include/llvm/Support/BuryPointer.h
index 276a5b7089c3e7..02144baed36af1 100644
--- a/llvm/include/llvm/Support/BuryPointer.h
+++ b/llvm/include/llvm/Support/BuryPointer.h
@@ -9,6 +9,7 @@
#ifndef LLVM_SUPPORT_BURYPOINTER_H
#define LLVM_SUPPORT_BURYPOINTER_H
+#include "llvm/Support/Compiler.h"
#include <memory>
namespace llvm {
@@ -19,7 +20,7 @@ namespace llvm {
// the memory is not misdiagnosed as an unintentional leak by leak detection
// tools (this is achieved by preserving pointers to the object in a globally
// visible array).
-void BuryPointer(const void *Ptr);
+LLVM_ABI void BuryPointer(const void *Ptr);
template <typename T> void BuryPointer(std::unique_ptr<T> Ptr) {
BuryPointer(Ptr.release());
}
diff --git a/llvm/include/llvm/Support/COM.h b/llvm/include/llvm/Support/COM.h
index d59966f849b485..53a599acc745b7 100644
--- a/llvm/include/llvm/Support/COM.h
+++ b/llvm/include/llvm/Support/COM.h
@@ -14,12 +14,13 @@
#ifndef LLVM_SUPPORT_COM_H
#define LLVM_SUPPORT_COM_H
+#include "llvm/Support/Compiler.h"
namespace llvm {
namespace sys {
enum class COMThreadingMode { SingleThreaded, MultiThreaded };
-class InitializeCOMRAII {
+class LLVM_ABI InitializeCOMRAII {
public:
explicit InitializeCOMRAII(COMThreadingMode Threading,
bool SpeedOverMemory = false);
diff --git a/llvm/include/llvm/Support/CRC.h b/llvm/include/llvm/Support/CRC.h
index 210890ae06d47c..b96e7664ba3724 100644
--- a/llvm/include/llvm/Support/CRC.h
+++ b/llvm/include/llvm/Support/CRC.h
@@ -13,17 +13,18 @@
#ifndef LLVM_SUPPORT_CRC_H
#define LLVM_SUPPORT_CRC_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
template <typename T> class ArrayRef;
// Compute the CRC-32 of Data.
-uint32_t crc32(ArrayRef<uint8_t> Data);
+LLVM_ABI uint32_t crc32(ArrayRef<uint8_t> Data);
// Compute the running CRC-32 of Data, with CRC being the previous value of the
// checksum.
-uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
+LLVM_ABI uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
// Class for computing the JamCRC.
//
@@ -42,7 +43,7 @@ uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
//
// N.B. We permit flexibility of the "Init" value. Some consumers of this need
// it to be zero.
-class JamCRC {
+class LLVM_ABI JamCRC {
public:
JamCRC(uint32_t Init = 0xFFFFFFFFU) : CRC(Init) {}
diff --git a/llvm/include/llvm/Support/CSKYAttributeParser.h b/llvm/include/llvm/Support/CSKYAttributeParser.h
index e926ebe5e306e3..4bf89e3f69d436 100644
--- a/llvm/include/llvm/Support/CSKYAttributeParser.h
+++ b/llvm/include/llvm/Support/CSKYAttributeParser.h
@@ -10,10 +10,11 @@
#define LLVM_SUPPORT_CSKYATTRIBUTEPARSER_H
#include "llvm/Support/CSKYAttributes.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ELFAttributeParser.h"
namespace llvm {
-class CSKYAttributeParser : public ELFAttributeParser {
+class LLVM_ABI CSKYAttributeParser : public ELFAttributeParser {
struct DisplayHandler {
CSKYAttrs::AttrType attribute;
Error (CSKYAttributeParser::*routine)(unsigned);
diff --git a/llvm/include/llvm/Support/CSKYAttributes.h b/llvm/include/llvm/Support/CSKYAttributes.h
index 723f2ceee8fb79..c16d3de96c2197 100644
--- a/llvm/include/llvm/Support/CSKYAttributes.h
+++ b/llvm/include/llvm/Support/CSKYAttributes.h
@@ -12,12 +12,13 @@
#ifndef LLVM_SUPPORT_CSKYATTRIBUTES_H
#define LLVM_SUPPORT_CSKYATTRIBUTES_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ELFAttributes.h"
namespace llvm {
namespace CSKYAttrs {
-const TagNameMap &getCSKYAttributeTags();
+LLVM_ABI const TagNameMap &getCSKYAttributeTags();
enum AttrType {
CSKY_ARCH_NAME = 4,
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index 17e148830a73f9..50d5ea41ec9ba9 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_CACHEPRUNING_H
#define LLVM_SUPPORT_CACHEPRUNING_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/MemoryBuffer.h"
#include <chrono>
#include <optional>
@@ -66,7 +67,7 @@ struct CachePruningPolicy {
/// For example: "prune_interval=30s:prune_after=24h:cache_size=50%"
/// which means a pruning interval of 30 seconds, expiration time of 24 hours
/// and maximum cache size of 50% of available disk space.
-Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
+LLVM_ABI Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
/// Peform pruning using the supplied policy, returns true if pruning
/// occurred, i.e. if Policy.Interval was expired.
@@ -79,7 +80,7 @@ Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
/// As a safeguard against data loss if the user specifies the wrong directory
/// as their cache directory, this function will ignore files not matching the
/// pattern "llvmcache-*".
-bool pruneCache(StringRef Path, CachePruningPolicy Policy,
+LLVM_ABI bool pruneCache(StringRef Path, CachePruningPolicy Policy,
const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
} // namespace llvm
diff --git a/llvm/include/llvm/Support/Caching.h b/llvm/include/llvm/Support/Caching.h
index cf45145619d95b..8c50902c42999b 100644
--- a/llvm/include/llvm/Support/Caching.h
+++ b/llvm/include/llvm/Support/Caching.h
@@ -15,6 +15,7 @@
#ifndef LLVM_SUPPORT_CACHING_H
#define LLVM_SUPPORT_CACHING_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -96,7 +97,7 @@ using AddBufferFn = std::function<void(unsigned Task, const Twine &ModuleName,
/// done lazily the first time a file is added. The cache name appears in error
/// messages for errors during caching. The temporary file prefix is used in the
/// temporary file naming scheme used when writing files atomically.
-Expected<FileCache> localCache(
+LLVM_ABI Expected<FileCache> localCache(
const Twine &CacheNameRef, const Twine &TempFilePrefixRef,
const Twine &CacheDirectoryPathRef,
AddBufferFn AddBuffer = [](size_t Task, const Twine &ModuleName,
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
index 71859af7c7e4a5..e20cd30687d915 100644
--- a/llvm/include/llvm/Support/Chrono.h
+++ b/llvm/include/llvm/Support/Chrono.h
@@ -77,8 +77,8 @@ toTimePoint(std::time_t T, uint32_t nsec) {
} // namespace sys
-raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
-raw_ostream &operator<<(raw...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/113097
More information about the llvm-commits
mailing list