mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
No longer need to sign-extend array indices to 64 bits since they
are now longs and not unsigned ints. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -952,13 +952,9 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
|
|||||||
|
|
||||||
for (; I != E; ++I)
|
for (; I != E; ++I)
|
||||||
if ((*I)->getType() == Type::LongTy) {
|
if ((*I)->getType() == Type::LongTy) {
|
||||||
Out << "[((int) ("; // sign-extend from 32 (to 64) bits
|
Out << "[";
|
||||||
writeOperand(*I);
|
writeOperand(*I);
|
||||||
Out << " * sizeof(";
|
Out << "]";
|
||||||
printType(cast<PointerType>(Ptr->getType())->getElementType());
|
|
||||||
Out << "))) / sizeof(";
|
|
||||||
printType(cast<PointerType>(Ptr->getType())->getElementType());
|
|
||||||
Out << ")]";
|
|
||||||
} else {
|
} else {
|
||||||
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
|
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
|
||||||
}
|
}
|
||||||
|
@ -952,13 +952,9 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
|
|||||||
|
|
||||||
for (; I != E; ++I)
|
for (; I != E; ++I)
|
||||||
if ((*I)->getType() == Type::LongTy) {
|
if ((*I)->getType() == Type::LongTy) {
|
||||||
Out << "[((int) ("; // sign-extend from 32 (to 64) bits
|
Out << "[";
|
||||||
writeOperand(*I);
|
writeOperand(*I);
|
||||||
Out << " * sizeof(";
|
Out << "]";
|
||||||
printType(cast<PointerType>(Ptr->getType())->getElementType());
|
|
||||||
Out << "))) / sizeof(";
|
|
||||||
printType(cast<PointerType>(Ptr->getType())->getElementType());
|
|
||||||
Out << ")]";
|
|
||||||
} else {
|
} else {
|
||||||
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
|
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user