mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
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:
parent
ac0077e143
commit
8da5d426d1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user