Skip to content

Commit 58a6949

Browse files
committed
[Support] Add missing LLVM_ABI annotations in Atomic.h
This fixes building LLD for mingw targets, with LLVM_BUILD_LLVM_DYLIB_VIS=ON. 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 e1d6753 commit 58a6949

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/include/llvm/Support/Atomic.h

Lines changed: 5 additions & 4 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,16 @@
2627

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

3132
#ifdef _MSC_VER
3233
typedef long cas_flag;
3334
#else
3435
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,
38+
cas_flag new_value,
39+
cas_flag old_value);
3940
}
4041
}
4142

0 commit comments

Comments
 (0)