diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:20:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:20:02 +0000 |
commit | ffd9bf404cd36c93d82b0080113ccc6d230915b3 (patch) | |
tree | 4641fcb4d84168ea1c1572d3dbbbc77db142066b | |
parent | 1f862af473dd5b0bfcc164cf4d6d4f4d0c63417e (diff) |
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
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index b3f8db7c42..958980bad6 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<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) { |