From 9d6f13f34bb7ae81f377149d520f81c496ca9879 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 15 Sep 2002 21:51:04 +0000 Subject: [PATCH] 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 --- lib/Target/CBackend/CBackend.cpp | 8 ++------ lib/Target/CBackend/Writer.cpp | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 55fc6704b7f..4d53b7adf65 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -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(Ptr->getType())->getElementType()); - Out << "))) / sizeof("; - printType(cast(Ptr->getType())->getElementType()); - Out << ")]"; + Out << "]"; } else { Out << ".field" << cast(*I)->getValue(); } diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 55fc6704b7f..4d53b7adf65 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -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(Ptr->getType())->getElementType()); - Out << "))) / sizeof("; - printType(cast(Ptr->getType())->getElementType()); - Out << ")]"; + Out << "]"; } else { Out << ".field" << cast(*I)->getValue(); }