diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-05-27 20:23:42 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-05-27 20:23:42 +0000 |
commit | 40e62dfdc03d1eb12b7d9961746d24383175ae96 (patch) | |
tree | 4dad33c65fc23da1e315b52cedf79fb494d0cf98 /llvm/lib | |
parent | ab366f055acc1f416d3dc8775aca97ed7f82ff2c (diff) | |
download | bcm5719-llvm-40e62dfdc03d1eb12b7d9961746d24383175ae96.tar.gz bcm5719-llvm-40e62dfdc03d1eb12b7d9961746d24383175ae96.zip |
Fix some bad fall-throughs in a switch statement. Both the 'Q' and 'R' cases
should fall through to the 'H' case, but instead 'Q' was falling through to 'R'
so that it would do the wrong thing for a big-endian ARM target.
llvm-svn: 104883
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index d95efdb8094..093f599a2b9 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -1064,21 +1064,27 @@ bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, printOperand(MI, OpNum, O); return false; case 'Q': - if (TM.getTargetData()->isLittleEndian()) + // Print the least significant half of a register pair. + if (TM.getTargetData()->isBigEndian()) break; - // Fallthrough + printOperand(MI, OpNum, O); + return false; case 'R': - if (TM.getTargetData()->isBigEndian()) + // Print the most significant half of a register pair. + if (TM.getTargetData()->isLittleEndian()) break; - // Fallthrough - case 'H': // Write second word of DI / DF reference. - // Verify that this operand has two consecutive registers. - if (!MI->getOperand(OpNum).isReg() || - OpNum+1 == MI->getNumOperands() || - !MI->getOperand(OpNum+1).isReg()) - return true; - ++OpNum; // Return the high-part. + printOperand(MI, OpNum, O); + return false; + case 'H': + break; } + // Print the second half of a register pair (for 'Q', 'R' or 'H'). + // Verify that this operand has two consecutive registers. + if (!MI->getOperand(OpNum).isReg() || + OpNum+1 == MI->getNumOperands() || + !MI->getOperand(OpNum+1).isReg()) + return true; + ++OpNum; } printOperand(MI, OpNum, O); |