Improve the efficiency and cleanup writing a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-04-16 20:20:02 +00:00
parent 1f862af473
commit ffd9bf404c

View File

@ -804,20 +804,22 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
bool PrintAllTypes = false;
const Type *TheType = Operand->getType();
for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) {
Operand = I.getOperand(i);
if (Operand->getType() != TheType) {
PrintAllTypes = true; // We have differing types! Print them all!
break;
// Shift Left & Right print both types even for Ubyte LHS
if (isa<ShiftInst>(I)) {
PrintAllTypes = true;
} else {
for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) {
Operand = I.getOperand(i);
if (Operand->getType() != TheType) {
PrintAllTypes = true; // We have differing types! Print them all!
break;
}
}
}
// Shift Left & Right print both types even for Ubyte LHS
if (isa<ShiftInst>(I)) PrintAllTypes = true;
if (!PrintAllTypes) {
Out << " ";
printType(I.getOperand(0)->getType());
printType(TheType);
}
for (unsigned i = 0, E = I.getNumOperands(); i != E; ++i) {