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:
Vikram S. Adve 2002-09-15 21:51:04 +00:00
parent 2d456601d8
commit 9d6f13f34b
2 changed files with 4 additions and 12 deletions

View File

@ -952,13 +952,9 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
for (; I != E; ++I)
if ((*I)->getType() == Type::LongTy) {
Out << "[((int) ("; // sign-extend from 32 (to 64) bits
Out << "[";
writeOperand(*I);
Out << " * sizeof(";
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << "))) / sizeof(";
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << ")]";
Out << "]";
} else {
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
}

View File

@ -952,13 +952,9 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
for (; I != E; ++I)
if ((*I)->getType() == Type::LongTy) {
Out << "[((int) ("; // sign-extend from 32 (to 64) bits
Out << "[";
writeOperand(*I);
Out << " * sizeof(";
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << "))) / sizeof(";
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << ")]";
Out << "]";
} else {
Out << ".field" << cast<ConstantUInt>(*I)->getValue();
}