[llvm-commits] [llvm] r72088 - /llvm/trunk/include/llvm/System/Atomic.h

Owen Anderson resistor at mac.com
Mon May 18 18:08:36 PDT 2009


Author: resistor
Date: Mon May 18 20:08:36 2009
New Revision: 72088

URL: http://llvm.org/viewvc/llvm-project?rev=72088&view=rev
Log:
Make using an unsupported CAS size a hard error on Windows.

Modified:
    llvm/trunk/include/llvm/System/Atomic.h

Modified: llvm/trunk/include/llvm/System/Atomic.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Atomic.h?rev=72088&r1=72087&r2=72088&view=diff

==============================================================================
--- llvm/trunk/include/llvm/System/Atomic.h (original)
+++ llvm/trunk/include/llvm/System/Atomic.h Mon May 18 20:08:36 2009
@@ -68,8 +68,10 @@
 			    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<typename T>





More information about the llvm-commits mailing list