diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-15 21:51:04 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-15 21:51:04 +0000 |
commit | 9d6f13f34bb7ae81f377149d520f81c496ca9879 (patch) | |
tree | e49c3a96bc6eeb2a329cff1ff9787ca510a6dd4e /lib | |
parent | 2d456601d81d952e2b2e68748389334946e70a40 (diff) | |
download | external_llvm-9d6f13f34bb7ae81f377149d520f81c496ca9879.zip external_llvm-9d6f13f34bb7ae81f377149d520f81c496ca9879.tar.gz external_llvm-9d6f13f34bb7ae81f377149d520f81c496ca9879.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 8 | ||||
-rw-r--r-- | 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 55fc670..4d53b7a 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<PointerType>(Ptr->getType())->getElementType()); - Out << "))) / sizeof("; - printType(cast<PointerType>(Ptr->getType())->getElementType()); - Out << ")]"; + Out << "]"; } else { Out << ".field" << cast<ConstantUInt>(*I)->getValue(); } diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 55fc670..4d53b7a 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<PointerType>(Ptr->getType())->getElementType()); - Out << "))) / sizeof("; - printType(cast<PointerType>(Ptr->getType())->getElementType()); - Out << ")]"; + Out << "]"; } else { Out << ".field" << cast<ConstantUInt>(*I)->getValue(); } |