1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Improve the efficiency and cleanup writing a bit

llvm-svn: 5782
This commit is contained in:
Chris Lattner 2003-04-16 20:20:02 +00:00
parent 638d4b0f28
commit 343a212f2b

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) {