Skip to content

Commit 6167b1e

Browse files
authored
[TableGen] Remove unnecessary use of utostr when writing to raw_ostream. NFC (#154800)
raw_ostream is capable of printing unsigned or uint64_t directly.
1 parent b3f04bf commit 6167b1e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/utils/TableGen/CodeEmitterGen.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ bool CodeEmitterGen::addCodeToMergeInOperand(const Record *R,
153153
if (!EncoderMethodName.empty()) {
154154
raw_string_ostream CaseOS(Case);
155155
CaseOS << indent(6);
156-
if (UseAPInt) {
157-
CaseOS << EncoderMethodName << "(MI, " + utostr(OpIdx) << ", op";
158-
} else {
159-
CaseOS << "op = " << EncoderMethodName << "(MI, " << utostr(OpIdx);
160-
}
156+
if (UseAPInt)
157+
CaseOS << EncoderMethodName << "(MI, " << OpIdx << ", op";
158+
else
159+
CaseOS << "op = " << EncoderMethodName << "(MI, " << OpIdx;
161160
CaseOS << ", Fixups, STI);\n";
162161
} else {
163162
if (UseAPInt) {
@@ -388,8 +387,7 @@ void CodeEmitterGen::addInstructionCasesForEncoding(
388387

389388
static void emitInstBits(raw_ostream &OS, const APInt &Bits) {
390389
for (unsigned I = 0; I < Bits.getNumWords(); ++I)
391-
OS << ((I > 0) ? ", " : "") << "UINT64_C(" << utostr(Bits.getRawData()[I])
392-
<< ")";
390+
OS << ((I > 0) ? ", " : "") << "UINT64_C(" << Bits.getRawData()[I] << ")";
393391
}
394392

395393
void CodeEmitterGen::emitInstructionBaseValues(

0 commit comments

Comments
 (0)