llvm.org GIT mirror llvm / 8d84ad6
[llvm-objdump] Don't print trailing space in dumpBytes In disassembly output, dumpBytes prints a space, followed by a tab printed by printInstr. Remove the extra space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358045 91177308-0d34-0410-b5e6-96231b3b80d8 Fangrui Song 7 months ago
2 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2020
2121 void llvm::dumpBytes(ArrayRef bytes, raw_ostream &OS) {
2222 static const char hex_rep[] = "0123456789abcdef";
23 bool First = true;
2324 for (char i: bytes) {
25 if (First)
26 First = false;
27 else
28 OS << ' ';
2429 OS << hex_rep[(i & 0xF0) >> 4];
2530 OS << hex_rep[i & 0xF];
26 OS << ' ';
2731 }
2832 }
2933
613613 if (MI)
614614 IP.printInst(MI, OS, "", STI);
615615 else
616 OS << " ";
616 OS << "\t";
617617 }
618618 };
619619 PrettyPrinter PrettyPrinterInst;
628628 if (!NoShowRawInsn) {
629629 OS << "\t";
630630 dumpBytes(Bytes.slice(0, 4), OS);
631 OS << format("%08" PRIx32, opcode);
631 OS << format("\t%08" PRIx32, opcode);
632632 }
633633 }
634634 void printInst(MCInstPrinter &IP, const MCInst *MI, ArrayRef Bytes,
767767 if (MI)
768768 IP.printInst(MI, OS, "", STI);
769769 else
770 OS << " ";
770 OS << "\t";
771771 }
772772 };
773773 BPFPrettyPrinter BPFPrettyPrinterInst;