summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-02 19:21:51 +0000
committerChris Lattner <sabre@nondot.org>2005-08-02 19:21:51 +0000
commit44060e08718f214c4cc7ad3d717d4fa7b1fac9a5 (patch)
tree98fdf995c03d6d57d02ee177d4a80fa4fe15acbd /llvm
parent22d00a8e902c9a82efb103eb494db8217eeb0f9d (diff)
downloadbcm5719-llvm-44060e08718f214c4cc7ad3d717d4fa7b1fac9a5.tar.gz
bcm5719-llvm-44060e08718f214c4cc7ad3d717d4fa7b1fac9a5.zip
Fix the non-gcc 4.0 path to compile
llvm-svn: 22593
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/MathExtras.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index 1e000b6e032..99c36dfaea0 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -88,7 +88,7 @@ inline unsigned CountLeadingZeros_32(unsigned Value) {
// PowerPC is defined for __builtin_clz(0)
#if defined(__ppc__) || defined(__ppc64__)
if (!Value) return 32;
-#endif
+ #endif
Count = __builtin_clz(Value);
#else
if (!Value) return 32;
@@ -117,7 +117,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
if (!Value) return 64;
#endif
Count = __builtin_clzll(Value);
- #elif sizeof(long) == sizeof(int64_t)
+ #else
+ if (sizeof(long) == sizeof(int64_t)) {
if (!Value) return 64;
Count = 0;
// bisecton method for count leading zeros
@@ -127,8 +128,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
Count |= Shift;
Value = Tmp;
}
-}
- #else
+ }
+ } else {
// get hi portion
unsigned Hi = Hi_32(Value);
@@ -142,7 +143,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
// same as 32 bit value
Count = CountLeadingZeros_32(Lo);
}
- #endif
+ }
+#endif
return Count;
}
OpenPOWER on IntegriCloud