[compiler-rt] r277363 - Use 'unsigned long' to match the APIs of the MS bitscan intrinsics

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 11:39:28 PDT 2016


Author: rnk
Date: Mon Aug  1 13:39:27 2016
New Revision: 277363

URL: http://llvm.org/viewvc/llvm-project?rev=277363&view=rev
Log:
Use 'unsigned long' to match the APIs of the MS bitscan intrinsics

We were getting warnings about how 'uint32_t*' is different from
'unsigned long*' even though they are effectively the same on Windows.

Modified:
    compiler-rt/trunk/lib/builtins/int_lib.h

Modified: compiler-rt/trunk/lib/builtins/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_lib.h?rev=277363&r1=277362&r2=277363&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/int_lib.h (original)
+++ compiler-rt/trunk/lib/builtins/int_lib.h Mon Aug  1 13:39:27 2016
@@ -91,14 +91,14 @@ COMPILER_RT_ABI tu_int __udivmodti4(tu_i
 #include <intrin.h>
 
 uint32_t __inline __builtin_ctz(uint32_t value) {
-  uint32_t trailing_zero = 0;
+  unsigned long trailing_zero = 0;
   if (_BitScanForward(&trailing_zero, value))
     return trailing_zero;
   return 32;
 }
 
 uint32_t __inline __builtin_clz(uint32_t value) {
-  uint32_t leading_zero = 0;
+  unsigned long leading_zero = 0;
   if (_BitScanReverse(&leading_zero, value))
     return 31 - leading_zero;
   return 32;
@@ -106,7 +106,7 @@ uint32_t __inline __builtin_clz(uint32_t
 
 #if defined(_M_ARM) || defined(_M_X64)
 uint32_t __inline __builtin_clzll(uint64_t value) {
-  uint32_t leading_zero = 0;
+  unsigned long leading_zero = 0;
   if (_BitScanReverse64(&leading_zero, value))
     return 63 - leading_zero;
   return 64;




More information about the llvm-commits mailing list