mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 14:10:41 +00:00
Emit:
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:
parent
8c3c4bfcfe
commit
8c8a37061a
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user