Fix -Werror build for runtime on android_arm32 and android_x86 (#3460)

This commit is contained in:
SvyatoslavScherbina
2019-10-14 17:01:41 +03:00
committed by GitHub
parent 3f868cc55d
commit 064d95baa3
+11
View File
@@ -39,6 +39,15 @@ ALWAYS_INLINE inline bool compareAndSet(volatile T* where, T expectedValue, T ne
#endif
}
#pragma clang diagnostic push
#if KONAN_ANDROID && (KONAN_ARM32 || KONAN_X86)
// On 32-bit Android clang generates library calls for "large" atomic operations
// and warns about "significant performance penalty". See more details here:
// https://github.com/llvm/llvm-project/blob/ce56e1a1cc5714f4af5675dd963cfebed766d9e1/clang/lib/CodeGen/CGAtomic.cpp#L775
// Ignore these warnings:
#pragma clang diagnostic ignored "-Watomic-alignment"
#endif
template <typename T>
ALWAYS_INLINE inline void atomicSet(volatile T* where, T what) {
@@ -60,6 +69,8 @@ ALWAYS_INLINE inline T atomicGet(volatile T* where) {
#endif
}
#pragma clang diagnostic pop
static ALWAYS_INLINE inline void synchronize() {
#ifndef KONAN_NO_THREADS
__sync_synchronize();