l3_reg109 = l81_this->field0;
Instead of:
  l3_reg109 = l81_this[0u].field0;

where possible


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2579 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-05-09 15:59:50 +00:00
parent 8c3c4bfcfe
commit 8c8a37061a
2 changed files with 26 additions and 4 deletions

View File

@ -517,8 +517,19 @@ void CInstPrintVisitor::visitFreeInst(FreeInst *I) {
void CInstPrintVisitor::printIndexingExpr(MemAccessInst *MAI) {
CW.writeOperand(MAI->getPointerOperand());
for (MemAccessInst::op_iterator I = MAI->idx_begin(), E = MAI->idx_end();
I != E; ++I)
MemAccessInst::op_iterator I = MAI->idx_begin(), E = MAI->idx_end();
if (I == E) return;
// Print out the -> operator if possible...
Constant *CI = dyn_cast<Constant>(*I);
if (CI && CI->isNullValue() && I+1 != E &&
(*(I+1))->getType() == Type::UByteTy) {
++I;
Out << "->field" << cast<ConstantUInt>(*I)->getValue();
++I;
}
for (; I != E; ++I)
if ((*I)->getType() == Type::UIntTy) {
Out << "[";
CW.writeOperand(*I);

View File

@ -517,8 +517,19 @@ void CInstPrintVisitor::visitFreeInst(FreeInst *I) {
void CInstPrintVisitor::printIndexingExpr(MemAccessInst *MAI) {
CW.writeOperand(MAI->getPointerOperand());
for (MemAccessInst::op_iterator I = MAI->idx_begin(), E = MAI->idx_end();
I != E; ++I)
MemAccessInst::op_iterator I = MAI->idx_begin(), E = MAI->idx_end();
if (I == E) return;
// Print out the -> operator if possible...
Constant *CI = dyn_cast<Constant>(*I);
if (CI && CI->isNullValue() && I+1 != E &&
(*(I+1))->getType() == Type::UByteTy) {
++I;
Out << "->field" << cast<ConstantUInt>(*I)->getValue();
++I;
}
for (; I != E; ++I)
if ((*I)->getType() == Type::UIntTy) {
Out << "[";
CW.writeOperand(*I);