Skip to content

[llvm][utils] Avoid 'raw_string_ostream::str()' (NFC) #97160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/utils/FileCheck/FileCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static void DumpAnnotatedInput(raw_ostream &OS, const FileCheckRequest &Req,
LineOS = &ElidedLinesOS;
else {
LineOS = &OS;
DumpEllipsisOrElidedLines(OS, ElidedLinesOS.str(), LabelWidth);
DumpEllipsisOrElidedLines(OS, ElidedLines, LabelWidth);
}

// Print right-aligned line number.
Expand Down Expand Up @@ -723,7 +723,7 @@ static void DumpAnnotatedInput(raw_ostream &OS, const FileCheckRequest &Req,
++AnnotationItr;
}
}
DumpEllipsisOrElidedLines(OS, ElidedLinesOS.str(), LabelWidth);
DumpEllipsisOrElidedLines(OS, ElidedLines, LabelWidth);

OS << ">>>>>>\n";
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/AsmMatcherEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2367,10 +2367,10 @@ emitConvertFuncs(CodeGenTarget &Target, StringRef ClassName,
OS << "};\n\n";

// Spit out the conversion driver function.
OS << CvtOS.str();
OS << ConvertFnBody;

// Spit out the operand number lookup function.
OS << OpOS.str();
OS << OperandFnBody;

return ConversionTable.size();
}
Expand Down
12 changes: 6 additions & 6 deletions llvm/utils/TableGen/AsmWriterEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,8 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
PatternCount - PatternStart);
}

if (OpcodeO.str().empty()) {
O << HeaderO.str();
if (PatternsForOpcode.empty()) {
O << Header;
O << " return false;\n";
O << "}\n\n";
O << "#endif // PRINT_ALIAS_INSTR\n";
Expand All @@ -1177,15 +1177,15 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
<< " const MCSubtargetInfo &STI,\n"
<< " unsigned PredicateIndex);\n";

O << HeaderO.str();
O << Header;
O.indent(2) << "static const PatternsForOpcode OpToPatterns[] = {\n";
O << OpcodeO.str();
O << PatternsForOpcode;
O.indent(2) << "};\n\n";
O.indent(2) << "static const AliasPattern Patterns[] = {\n";
O << PatternO.str();
O << Patterns;
O.indent(2) << "};\n\n";
O.indent(2) << "static const AliasPatternCond Conds[] = {\n";
O << CondO.str();
O << Conds;
O.indent(2) << "};\n\n";
O.indent(2) << "static const char AsmStrings[] =\n";
for (const auto &P : AsmStrings) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/Common/VarLenCodeEmitterGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void VarLenCodeEmitterGen::emitInstructionBaseValues(
IS.indent(4) << "{/*NumBits*/0, /*Index*/0}\n };\n";
SS.indent(4) << "UINT64_C(0)\n };\n";

OS << IS.str() << SS.str();
OS << IndexArray << StorageArray;
}

std::string VarLenCodeEmitterGen::getInstructionCases(Record *R,
Expand Down
Loading