@@ -866,48 +866,46 @@ static void printMI(raw_ostream &OS, MFPrintState &State,
866866
867867 OS << TII->getName (MI.getOpcode ());
868868
869- LS = ListSeparator ();
869+ // Print a space after the opcode if any additional tokens are printed.
870+ LS = ListSeparator (" , " , " " );
870871
871- if (I < E) {
872- OS << ' ' ;
873- for (; I < E; ++I) {
874- OS << LS;
875- printMIOperand (OS, State, MI, I, TRI, TII, ShouldPrintRegisterTies,
876- PrintedTypes, MRI, /* PrintDef=*/ true );
877- }
872+ for (; I < E; ++I) {
873+ OS << LS;
874+ printMIOperand (OS, State, MI, I, TRI, TII, ShouldPrintRegisterTies,
875+ PrintedTypes, MRI, /* PrintDef=*/ true );
878876 }
879877
880878 // Print any optional symbols attached to this instruction as-if they were
881879 // operands.
882880 if (MCSymbol *PreInstrSymbol = MI.getPreInstrSymbol ()) {
883- OS << LS << " pre-instr-symbol " ;
881+ OS << LS << " pre-instr-symbol " ;
884882 MachineOperand::printSymbol (OS, *PreInstrSymbol);
885883 }
886884 if (MCSymbol *PostInstrSymbol = MI.getPostInstrSymbol ()) {
887- OS << LS << " post-instr-symbol " ;
885+ OS << LS << " post-instr-symbol " ;
888886 MachineOperand::printSymbol (OS, *PostInstrSymbol);
889887 }
890888 if (MDNode *HeapAllocMarker = MI.getHeapAllocMarker ()) {
891- OS << LS << " heap-alloc-marker " ;
889+ OS << LS << " heap-alloc-marker " ;
892890 HeapAllocMarker->printAsOperand (OS, State.MST );
893891 }
894892 if (MDNode *PCSections = MI.getPCSections ()) {
895- OS << LS << " pcsections " ;
893+ OS << LS << " pcsections " ;
896894 PCSections->printAsOperand (OS, State.MST );
897895 }
898896 if (MDNode *MMRA = MI.getMMRAMetadata ()) {
899- OS << LS << " mmra " ;
897+ OS << LS << " mmra " ;
900898 MMRA->printAsOperand (OS, State.MST );
901899 }
902900 if (uint32_t CFIType = MI.getCFIType ())
903- OS << LS << " cfi-type " << CFIType;
901+ OS << LS << " cfi-type " << CFIType;
904902
905903 if (auto Num = MI.peekDebugInstrNum ())
906- OS << LS << " debug-instr-number " << Num;
904+ OS << LS << " debug-instr-number " << Num;
907905
908906 if (PrintLocations) {
909907 if (const DebugLoc &DL = MI.getDebugLoc ()) {
910- OS << LS << " debug-location " ;
908+ OS << LS << " debug-location " ;
911909 DL->printAsOperand (OS, State.MST );
912910 }
913911 }
0 commit comments