aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/CBackend/CBackend.cpp8
-rw-r--r--lib/Target/CBackend/Writer.cpp8
2 files changed, 4 insertions, 12 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 55fc6704b7..4d53b7adf6 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 55fc6704b7..4d53b7adf6 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();
}