From 84e5cac70ae394d708614016db20eb0cfbe82ec2 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 19 May 2009 01:08:36 +0000 Subject: [PATCH] Make using an unsupported CAS size a hard error on Windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72088 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/System/Atomic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/System/Atomic.h b/include/llvm/System/Atomic.h index 5bdbaffe023..5830b37083b 100644 --- a/include/llvm/System/Atomic.h +++ b/include/llvm/System/Atomic.h @@ -68,8 +68,10 @@ namespace llvm { T old_value) { if (sizeof(T) == 4) return InterlockedCompareExchange(ptr, new_value, old_value); - else + else if (sizeof(T) == 8) return InterlockedCompareExchange64(ptr, new_value, old_value); + else + assert(0 && "Unsupported compare-and-swap size!"); } template