Use stripPointerCasts when checking for AllocaInsts for the stackprotector intrinsic.
[oota-llvm.git] / lib / VMCore / ValueTypes.cpp
index d02a538eb248beaf9d172f47211583ed2abc306d..0229f155bc97b78ae986d5c3441780d161acb0ee 100644 (file)
@@ -71,6 +71,7 @@ unsigned MVT::getExtendedSizeInBits() const {
   if (const VectorType *VTy = dyn_cast<VectorType>(LLVMTy))
     return VTy->getBitWidth();
   assert(false && "Unrecognized extended type!");
+  return 0; // Suppress warnings.
 }
 
 /// getMVTString - This function returns value type as a string, e.g. "i32".
@@ -120,13 +121,8 @@ std::string MVT::getMVTString() const {
 const Type *MVT::getTypeForMVT() const {
   switch (V) {
   default:
-    if (isVector())
-      return VectorType::get(getVectorElementType().getTypeForMVT(),
-                             getVectorNumElements());
-    if (isInteger())
-      return IntegerType::get(getSizeInBits());
-    assert(0 && "MVT does not correspond to LLVM type!");
-    return Type::VoidTy;
+    assert(isExtended() && "Type is not extended!");
+    return LLVMTy;
   case MVT::isVoid:  return Type::VoidTy;
   case MVT::i1:      return Type::Int1Ty;
   case MVT::i8:      return Type::Int8Ty;