From ffd9bf404cd36c93d82b0080113ccc6d230915b3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 16 Apr 2003 20:20:02 +0000 Subject: [PATCH] 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 --- lib/VMCore/AsmWriter.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index b3f8db7c423..958980bad67 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -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(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(I)) PrintAllTypes = true; - + if (!PrintAllTypes) { Out << " "; - printType(I.getOperand(0)->getType()); + printType(TheType); } for (unsigned i = 0, E = I.getNumOperands(); i != E; ++i) { -- 2.34.1