No longer need to sign-extend array indices to 64 bits since they
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 15 Sep 2002 21:51:04 +0000 (21:51 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 15 Sep 2002 21:51:04 +0000 (21:51 +0000)
are now longs and not unsigned ints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3731 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 55fc6704b7f2d3348c11be1b6666967112b15d34..4d53b7adf658f2c9f687198dab194c670388f702 100644 (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();
     }
index 55fc6704b7f2d3348c11be1b6666967112b15d34..4d53b7adf658f2c9f687198dab194c670388f702 100644 (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();
     }