Skip to content

Commit 08873be

Browse files
authored
[Support] Add missing LLVM_ABI annotations in Atomic.h (#152768)
This fixes building LLD for mingw targets with LLVM_BUILD_LLVM_DYLIB_VIS=ON with Clang. This has been missed for other platforms, as those platforms have LLVM_THREADING_USE_STD_CALL_ONCE=1 in llvm/Support/Threading.h, while it ends up set to 0, using CompareAndSwap() and MemoryFence() instead, for mingw targets.
1 parent 5bb7ba6 commit 08873be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/include/llvm/Support/Atomic.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef LLVM_SUPPORT_ATOMIC_H
1818
#define LLVM_SUPPORT_ATOMIC_H
1919

20+
#include "llvm/Support/Compiler.h"
2021
#include "llvm/Support/DataTypes.h"
2122

2223
// Windows will at times define MemoryFence.
@@ -26,16 +27,15 @@
2627

2728
namespace llvm {
2829
namespace sys {
29-
void MemoryFence();
30+
LLVM_ABI void MemoryFence();
3031

3132
#ifdef _MSC_VER
32-
typedef long cas_flag;
33+
typedef long cas_flag;
3334
#else
34-
typedef uint32_t cas_flag;
35+
typedef uint32_t cas_flag;
3536
#endif
36-
cas_flag CompareAndSwap(volatile cas_flag* ptr,
37-
cas_flag new_value,
38-
cas_flag old_value);
37+
LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag *ptr, cas_flag new_value,
38+
cas_flag old_value);
3939
}
4040
}
4141

0 commit comments

Comments
 (0)