[llvm-commits] [llvm-gcc-4.2] r56632 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Evan Cheng evan.cheng at apple.com
Thu Sep 25 17:49:32 PDT 2008


Author: evancheng
Date: Thu Sep 25 19:49:32 2008
New Revision: 56632

URL: http://llvm.org/viewvc/llvm-project?rev=56632&view=rev
Log:
Fix typos and clean up code per Duncan's feedback.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=56632&r1=56631&r2=56632&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Sep 25 19:49:32 2008
@@ -3208,18 +3208,15 @@
 /// type with floating point elements, return an integer type to bitcast to.
 /// e.g. 4 x float -> 4 x i32
 static const Type *getSuitableBitCastIntType(const Type *Ty) {
-  if (Ty == Type::FloatTy)
-    return Type::Int32Ty;
-  else if (Ty == Type::DoubleTy)
-    return Type::Int64Ty;
-  else if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
+  if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
     unsigned NumElements = VTy->getNumElements();
     const Type *EltTy = VTy->getElementType();
     if (EltTy == Type::FloatTy)
       return VectorType::get(Type::Int32Ty, NumElements);
     else if (EltTy == Type::DoubleTy)
       return VectorType::get(Type::Int64Ty, NumElements);
-  }
+  } else
+    return IntegerType::get(Ty->getPrimitiveSizeInBits());
   return NULL;
 }
 
@@ -3317,7 +3314,7 @@
   LHS = CastToAnyType(LHS, LHSIsSigned, Ty, TyIsSigned);
   RHS = CastToAnyType(RHS, RHSIsSigned, Ty, TyIsSigned);
 
-  // If it's And, Or, or Xor, may sure the oeprands are casted to the right
+  // If it's And, Or, or Xor, make sure the operands are casted to the right
   // integer types first.
   bool isLogicalOp = Opc == Instruction::And || Opc == Instruction::Or ||
     Opc == Instruction::Xor;





More information about the llvm-commits mailing list