Fix pessimizations on sized arrays

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1423 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-12-05 19:40:32 +00:00
parent ac0077e143
commit 8da5d426d1

View File

@ -539,7 +539,9 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB,
if (!ThePtrType) return false;
const Type *ElTy = ThePtrType->getElementType();
if (isa<MethodType>(ElTy) || isa<ArrayType>(ElTy)) return false;
if (isa<MethodType>(ElTy) ||
(isa<ArrayType>(ElTy) && cast<ArrayType>(ElTy)->isUnsized()))
return false;
unsigned ElementSize = TD.getTypeSize(ElTy);
bool InsertCast = false;
@ -586,7 +588,7 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB,
//
ValueTypeCache ConvertedTypes;
if (!ValueConvertableToType(V, DestTy, ConvertedTypes)) {
cerr << "FAILED to convert types of values for " << V << "\n";
cerr << "FAILED to convert types of values for " << V << " to " << DestTy << "\n";
ConvertedTypes.clear();
ValueConvertableToType(V, DestTy, ConvertedTypes);
return false;