micro optimization: isSizedDerivedType is only called with arrays, vectors and structs.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 6 Dec 2013 20:12:19 +0000 (20:12 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 6 Dec 2013 20:12:19 +0000 (20:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196604 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Type.cpp

index 432cbc99f5e66197626c5d6f1502edee3757eca2..03b1122e9e460cc0c2db39c8a50298d6de489531 100644 (file)
@@ -156,18 +156,12 @@ int Type::getFPMantissaWidth() const {
 /// iff all of the members of the type are sized as well.  Since asking for
 /// their size is relatively uncommon, move this operation out of line.
 bool Type::isSizedDerivedType() const {
-  if (this->isIntegerTy())
-    return true;
-
   if (const ArrayType *ATy = dyn_cast<ArrayType>(this))
     return ATy->getElementType()->isSized();
 
   if (const VectorType *VTy = dyn_cast<VectorType>(this))
     return VTy->getElementType()->isSized();
 
-  if (!this->isStructTy()) 
-    return false;
-
   return cast<StructType>(this)->isSized();
 }