Skip to content

Commit d31e314

Browse files
committed
[llvm] Don't call raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op. As specified in the docs, raw_string_ostream is always unbuffered. ( 65b1361 for further reference )
1 parent efb5831 commit d31e314

File tree

19 files changed

+0
-22
lines changed

19 files changed

+0
-22
lines changed

llvm/lib/Analysis/CallGraphSCCPass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ bool CGPassManager::RunAllPassesOnSCC(CallGraphSCC &CurSCC, CallGraph &CG,
453453
OS << LS;
454454
CGN->print(OS);
455455
}
456-
OS.flush();
457456
#endif
458457
dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, Functions);
459458
}

llvm/lib/CodeGen/MIRPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ void MIRPrinter::print(const MachineFunction &MF) {
256256
.print(MBB);
257257
IsNewlineNeeded = true;
258258
}
259-
StrOS.flush();
260259
// Convert machine metadata collected during the print of the machine
261260
// function.
262261
convertMachineMetadataNodes(YamlMF, MF, MST);

llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
620620
// Print ThreadLogStorage lines into an actual stream under a lock
621621
std::lock_guard<std::mutex> guard(LogMutex);
622622
if (Out.GetOS()) {
623-
StrStream.flush();
624623
Out << storage;
625624
}
626625
Out.Merge(ThreadOut);

llvm/lib/IRReader/IRReader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
124124
raw_string_ostream os(buf);
125125

126126
Diag.print(nullptr, os, false);
127-
os.flush();
128127

129128
*OutMessage = strdup(buf.c_str());
130129
}

llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ void UnknownSymbolRecord::map(yaml::IO &io) {
308308
std::string Str;
309309
raw_string_ostream OS(Str);
310310
Binary.writeAsBinary(OS);
311-
OS.flush();
312311
Data.assign(Str.begin(), Str.end());
313312
}
314313
}

llvm/lib/TableGen/Record.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,6 @@ Init *UnOpInit::Fold(Record *CurRec, bool IsFinal) const {
838838
std::string S;
839839
raw_string_ostream OS(S);
840840
OS << *Def->getDef();
841-
OS.flush();
842841
return StringInit::get(RK, S);
843842
} else {
844843
// Otherwise, print the value of the variable.

llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ void AMDGPUAsmPrinter::emitInstruction(const MachineInstr *MI) {
321321
HexStream << format("%s%08X", (i > 0 ? " " : ""), CodeDWord);
322322
}
323323

324-
DisasmStream.flush();
325324
DisasmLineMaxLen = std::max(DisasmLineMaxLen, DisasmLine.size());
326325
}
327326
}

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6094,7 +6094,6 @@ bool AMDGPUAsmParser::ParseToEndDirective(const char *AssemblerDirectiveBegin,
60946094
Twine(AssemblerDirectiveEnd) + Twine(" not found"));
60956095
}
60966096

6097-
CollectStream.flush();
60986097
return false;
60996098
}
61006099

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,6 @@ std::string AMDGPUTargetID::toString() const {
904904

905905
StreamRep << Processor << Features;
906906

907-
StreamRep.flush();
908907
return StringRep;
909908
}
910909

llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,6 @@ std::string NVPTXAsmPrinter::getVirtualRegisterName(unsigned Reg) const {
596596

597597
NameStr << getNVPTXRegClassStr(RC) << MappedVR;
598598

599-
NameStr.flush();
600599
return Name;
601600
}
602601

0 commit comments

Comments
 (0)