Skip to content

Commit 619151b

Browse files
committed
Review feedback: use left_justify
1 parent 8faca4a commit 619151b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llvm/utils/TableGen/InstrInfoEmitter.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "llvm/ADT/SmallVector.h"
2626
#include "llvm/ADT/StringExtras.h"
2727
#include "llvm/Support/Casting.h"
28-
#include "llvm/Support/FormattedStream.h"
28+
#include "llvm/Support/Format.h"
2929
#include "llvm/Support/SourceMgr.h"
3030
#include "llvm/Support/raw_ostream.h"
3131
#include "llvm/TableGen/Error.h"
@@ -1291,9 +1291,8 @@ void InstrInfoEmitter::emitRecord(
12911291

12921292
// emitEnums - Print out enum values for all of the instructions.
12931293
void InstrInfoEmitter::emitEnums(
1294-
raw_ostream &RawOS,
1294+
raw_ostream &OS,
12951295
ArrayRef<const CodeGenInstruction *> NumberedInstructions) {
1296-
formatted_raw_ostream OS(RawOS);
12971296
OS << "#ifdef GET_INSTRINFO_ENUM\n";
12981297
OS << "#undef GET_INSTRINFO_ENUM\n";
12991298

@@ -1314,11 +1313,10 @@ void InstrInfoEmitter::emitEnums(
13141313

13151314
OS << " enum {\n";
13161315
for (const CodeGenInstruction *Inst : NumberedInstructions) {
1317-
OS << " " << Inst->TheDef->getName();
1318-
OS.PadToColumn(MaxNameSize + 5);
1319-
OS << " = " << Target.getInstrIntValue(Inst->TheDef) << ", // ";
1320-
OS << SrcMgr.getFormattedLocationNoOffset(Inst->TheDef->getLoc().front());
1321-
OS << '\n';
1316+
OS << " " << left_justify(Inst->TheDef->getName(), MaxNameSize) << " = "
1317+
<< Target.getInstrIntValue(Inst->TheDef) << ", // "
1318+
<< SrcMgr.getFormattedLocationNoOffset(Inst->TheDef->getLoc().front())
1319+
<< '\n';
13221320
}
13231321
OS << " INSTRUCTION_LIST_END = " << NumberedInstructions.size() << '\n';
13241322
OS << " };\n";

0 commit comments

Comments
 (0)