[cfe-commits] r106206 - in /cfe/trunk/lib: CodeGen/CGBuiltin.cpp Sema/SemaChecking.cpp

Nate Begeman natebegeman at mac.com
Wed Jun 16 19:26:59 PDT 2010


Author: sampo
Date: Wed Jun 16 21:26:59 2010
New Revision: 106206

URL: http://llvm.org/viewvc/llvm-project?rev=106206&view=rev
Log:
Remove last of the bool shifts for MS VC++, patch by dimitry andric

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=106206&r1=106205&r2=106206&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jun 16 21:26:59 2010
@@ -952,13 +952,13 @@
   switch (type) {
     default: break;
     case 0: 
-    case 5: return llvm::VectorType::get(llvm::Type::getInt8Ty(Ctx), 8 << q);
+    case 5: return llvm::VectorType::get(llvm::Type::getInt8Ty(Ctx), 8 << (int)q);
     case 6:
     case 7:
-    case 1: return llvm::VectorType::get(llvm::Type::getInt16Ty(Ctx), 4 << q);
-    case 2: return llvm::VectorType::get(llvm::Type::getInt32Ty(Ctx), 2 << q);
-    case 3: return llvm::VectorType::get(llvm::Type::getInt64Ty(Ctx), 1 << q);
-    case 4: return llvm::VectorType::get(llvm::Type::getFloatTy(Ctx), 2 << q);
+    case 1: return llvm::VectorType::get(llvm::Type::getInt16Ty(Ctx), 4 << (int)q);
+    case 2: return llvm::VectorType::get(llvm::Type::getInt32Ty(Ctx), 2 << (int)q);
+    case 3: return llvm::VectorType::get(llvm::Type::getInt64Ty(Ctx), 1 << (int)q);
+    case 4: return llvm::VectorType::get(llvm::Type::getFloatTy(Ctx), 2 << (int)q);
   };
   return 0;
 }

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=106206&r1=106205&r2=106206&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Jun 16 21:26:59 2010
@@ -248,25 +248,25 @@
   
   switch (t & 0x7) {
     case 0: // i8
-      return shift ? 7 : (8 << quad) - 1;
+      return shift ? 7 : (8 << (int)quad) - 1;
     case 1: // i16
-      return shift ? 15 : (4 << quad) - 1;
+      return shift ? 15 : (4 << (int)quad) - 1;
     case 2: // i32
-      return shift ? 31 : (2 << quad) - 1;
+      return shift ? 31 : (2 << (int)quad) - 1;
     case 3: // i64
-      return shift ? 63 : (1 << quad) - 1;
+      return shift ? 63 : (1 << (int)quad) - 1;
     case 4: // f32
       assert(!shift && "cannot shift float types!");
-      return (2 << quad) - 1;
+      return (2 << (int)quad) - 1;
     case 5: // poly8
       assert(!shift && "cannot shift polynomial types!");
-      return (8 << quad) - 1;
+      return (8 << (int)quad) - 1;
     case 6: // poly16
       assert(!shift && "cannot shift polynomial types!");
-      return (4 << quad) - 1;
+      return (4 << (int)quad) - 1;
     case 7: // float16
       assert(!shift && "cannot shift float types!");
-      return (4 << quad) - 1;
+      return (4 << (int)quad) - 1;
   }
   return 0;
 }





More information about the cfe-commits mailing list