diff options
| author | Hans Wennborg <hans@hanshq.net> | 2018-04-20 07:34:59 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2018-04-20 07:34:59 +0000 |
| commit | 2473183c15a2396a307c6f8fdc921608185a8a5a (patch) | |
| tree | 1b930d39a601d8ae722147ada94dd28c90ff4446 /compiler-rt | |
| parent | 149916d29a160727b1360742829837302e24fa93 (diff) | |
| download | bcm5719-llvm-2473183c15a2396a307c6f8fdc921608185a8a5a.tar.gz bcm5719-llvm-2473183c15a2396a307c6f8fdc921608185a8a5a.zip | |
Revert r330376 "[sanitizer] Generalize atomic_uint8_t, atomic_uint16_t, ... into a template. NFC."
This broke the Windows build, see e.g. http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10130
> Differential Revision: https://reviews.llvm.org/D44246
llvm-svn: 330395
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_atomic.h | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h b/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h index f61efe839c6..8f400acc999 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h @@ -27,18 +27,36 @@ enum memory_order { memory_order_seq_cst = 1 << 5 }; -template<typename T> -struct atomic { - typedef T Type; - volatile Type ALIGNED(sizeof(Type)) val_dont_use; +struct atomic_uint8_t { + typedef u8 Type; + volatile Type val_dont_use; +}; + +struct atomic_uint16_t { + typedef u16 Type; + volatile Type val_dont_use; +}; + +struct atomic_sint32_t { + typedef s32 Type; + volatile Type val_dont_use; }; -typedef atomic<u8> atomic_uint8_t; -typedef atomic<u16> atomic_uint16_t; -typedef atomic<s32> atomic_sint32_t; -typedef atomic<u32> atomic_uint32_t; -typedef atomic<u64> atomic_uint64_t; -typedef atomic<uptr> atomic_uintptr_t; +struct atomic_uint32_t { + typedef u32 Type; + volatile Type val_dont_use; +}; + +struct atomic_uint64_t { + typedef u64 Type; + // On 32-bit platforms u64 is not necessary aligned on 8 bytes. + volatile ALIGNED(8) Type val_dont_use; +}; + +struct atomic_uintptr_t { + typedef uptr Type; + volatile Type val_dont_use; +}; } // namespace __sanitizer |

