Skip to content
Closed
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
2 changes: 0 additions & 2 deletions llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,6 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {

raw_string_ostream OS(Result);
OS << "color=\"red\"";
OS.flush();
return Result;
}

Expand Down Expand Up @@ -1898,7 +1897,6 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
}
}

OS.flush();
return Str;
}
};
Expand Down
2 changes: 0 additions & 2 deletions llvm/include/llvm/Analysis/LazyCallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ class LazyCallGraph {
std::string Name;
raw_string_ostream OS(Name);
OS << *this;
OS.flush();
return Name;
}
};
Expand Down Expand Up @@ -652,7 +651,6 @@ class LazyCallGraph {
std::string Name;
raw_string_ostream OS(Name);
OS << *this;
OS.flush();
return Name;
}

Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Support/FormatVariadic.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class formatv_object_base {
std::string Result;
raw_string_ostream Stream(Result);
Stream << *this;
Stream.flush();
return Result;
}

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ bool DWARFVerifier::verifyName(const DWARFDie &Die) {
raw_string_ostream OS(ReconstructedName);
std::string OriginalFullName;
Die.getFullName(OS, &OriginalFullName);
OS.flush();
if (OriginalFullName.empty() || OriginalFullName == ReconstructedName)
return false;

Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/IR/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
Result += '(';
raw_string_ostream OS(Result);
getValueAsType()->print(OS, false, true);
OS.flush();
Result += ')';
return Result;
}
Expand Down Expand Up @@ -642,7 +641,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
OS << getModRefStr(MR);
}
OS << ")";
OS.flush();
return Result;
}

Expand All @@ -661,7 +659,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
OS << "i" << CR.getBitWidth() << " ";
OS << CR.getLower() << ", " << CR.getUpper();
OS << ")";
OS.flush();
return Result;
}

Expand All @@ -672,7 +669,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
OS << "initializes(";
CRL.print(OS);
OS << ")";
OS.flush();
return Result;
}

Expand Down
8 changes: 0 additions & 8 deletions llvm/lib/IR/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI) {
DiagnosticPrinterRawOStream DP(Stream);

unwrap(DI)->print(DP);
Stream.flush();

return LLVMCreateMessage(MsgStorage.c_str());
}
Expand Down Expand Up @@ -473,7 +472,6 @@ char *LLVMPrintModuleToString(LLVMModuleRef M) {
raw_string_ostream os(buf);

unwrap(M)->print(os, nullptr);
os.flush();

return strdup(buf.c_str());
}
Expand Down Expand Up @@ -652,8 +650,6 @@ char *LLVMPrintTypeToString(LLVMTypeRef Ty) {
else
os << "Printing <null> Type";

os.flush();

return strdup(buf.c_str());
}

Expand Down Expand Up @@ -1046,8 +1042,6 @@ char* LLVMPrintValueToString(LLVMValueRef Val) {
else
os << "Printing <null> Value";

os.flush();

return strdup(buf.c_str());
}

Expand All @@ -1064,8 +1058,6 @@ char *LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record) {
else
os << "Printing <null> DbgRecord";

os.flush();

return strdup(buf.c_str());
}

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/IR/DiagnosticInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ void DiagnosticInfoUnsupported::print(DiagnosticPrinter &DP) const {

OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
<< *getFunction().getFunctionType() << ": " << Msg << '\n';
OS.flush();
DP << Str;
}

Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/IR/Mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
std::string Flag;
raw_string_ostream FlagOS(Flag);
Mangler.getNameWithPrefix(FlagOS, GV, false);
FlagOS.flush();
if (Flag[0] == GV->getDataLayout().getGlobalPrefix())
OS << Flag.substr(1);
else
Expand Down Expand Up @@ -265,7 +264,6 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
std::string Flag;
raw_string_ostream FlagOS(Flag);
Mangler.getNameWithPrefix(FlagOS, GV, false);
FlagOS.flush();
if (Flag[0] == GV->getDataLayout().getGlobalPrefix())
OS << Flag.substr(1);
else
Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/Object/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ ArchiveMemberHeader::ArchiveMemberHeader(const Archive *Parent,
raw_string_ostream OS(Buf);
OS.write_escaped(
StringRef(ArMemHdr->Terminator, sizeof(ArMemHdr->Terminator)));
OS.flush();
std::string Msg("terminator characters in archive member \"" + Buf +
"\" not the correct \"`\\n\" values for the archive "
"member header ");
Expand Down Expand Up @@ -282,7 +281,6 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const {
std::string Buf;
raw_string_ostream OS(Buf);
OS.write_escaped(Name.substr(1).rtrim(' '));
OS.flush();
uint64_t ArchiveOffset =
reinterpret_cast<const char *>(ArMemHdr) - Parent->getData().data();
return malformedError("long name offset characters after the '/' are "
Expand Down Expand Up @@ -321,7 +319,6 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const {
std::string Buf;
raw_string_ostream OS(Buf);
OS.write_escaped(Name.substr(3).rtrim(' '));
OS.flush();
uint64_t ArchiveOffset =
reinterpret_cast<const char *>(ArMemHdr) - Parent->getData().data();
return malformedError("long name length characters after the #1/ are "
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Object/ArchiveWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ static MemberData computeStringTable(StringRef Names) {
printWithSpacePadding(Out, "//", 48);
printWithSpacePadding(Out, Size + Pad, 10);
Out << "`\n";
Out.flush();
return {{}, std::move(Header), Names, Pad ? "\n" : ""};
}

Expand Down Expand Up @@ -959,7 +958,6 @@ computeMemberData(raw_ostream &StringTable, raw_ostream &SymNames,
printMemberHeader(Out, Pos, StringTable, MemberNames, Kind, Thin, *M,
ModTime, Size);
}
Out.flush();

std::vector<unsigned> Symbols;
if (NeedSymbols != SymtabWritingMode::NoSymtab) {
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Object/IRSymtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ Error Builder::addSymbol(const ModuleSymbolTable &Msymtab,
std::string FallbackName;
raw_string_ostream OS(FallbackName);
Msymtab.printSymbolName(OS, Fallback);
OS.flush();
setStr(Uncommon().COFFWeakExternFallbackName, Saver.save(FallbackName));
}
}
Expand All @@ -358,7 +357,6 @@ Error Builder::build(ArrayRef<Module *> IRMods) {
if (Error Err = addModule(M))
return Err;

COFFLinkerOptsOS.flush();
setStr(Hdr.COFFLinkerOpts, Saver.save(COFFLinkerOpts));

// We are about to fill in the header's range fields, so reserve space for it
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/ObjectYAML/DWARFEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,6 @@ emitDebugSectionImpl(const DWARFYAML::Data &DI, StringRef Sec,

if (Error Err = EmitFunc(DebugInfoStream, DI))
return Err;
DebugInfoStream.flush();
if (!Data.empty())
OutputBuffers[Sec] = MemoryBuffer::getMemBufferCopy(Data);

Expand Down
5 changes: 0 additions & 5 deletions llvm/lib/ObjectYAML/WasmEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class SubSectionWriter {
SubSectionWriter(raw_ostream &OS) : OS(OS), StringStream(OutString) {}

void done() {
StringStream.flush();
encodeULEB128(OutString.size(), OS);
OS << OutString;
OutString.clear();
Expand Down Expand Up @@ -537,7 +536,6 @@ void WasmWriter::writeSectionContent(raw_ostream &OS,
Func.Body.writeAsBinary(StringStream);

// Write the section size followed by the content
StringStream.flush();
encodeULEB128(OutString.size(), OS);
OS << OutString;
}
Expand Down Expand Up @@ -645,8 +643,6 @@ bool WasmWriter::writeWasm(raw_ostream &OS) {
if (HasError)
return false;

StringStream.flush();

unsigned HeaderSecSizeEncodingLen =
Sec->HeaderSecSizeEncodingLen.value_or(5);
unsigned RequiredLen = getULEB128Size(OutString.size());
Expand Down Expand Up @@ -674,7 +670,6 @@ bool WasmWriter::writeWasm(raw_ostream &OS) {
std::string OutString;
raw_string_ostream StringStream(OutString);
writeRelocSection(StringStream, *Sec, SectionIndex++);
StringStream.flush();

encodeULEB128(OutString.size(), OS);
OS << OutString;
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Remarks/YAMLRemarkParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static void handleDiagnostic(const SMDiagnostic &Diag, void *Ctx) {
Diag.print(/*ProgName=*/nullptr, OS, /*ShowColors*/ false,
/*ShowKindLabels*/ true);
OS << '\n';
OS.flush();
}

YAMLParseError::YAMLParseError(StringRef Msg, SourceMgr &SM,
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/lli/lli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ int main(int argc, char **argv, char * const *envp) {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(ArOrErr.takeError(), OS);
OS.flush();
errs() << Buf;
exit(1);
}
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-ifs/llvm-ifs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ static Error writeIFS(StringRef FilePath, IFSStub &Stub, bool WriteIfChanged) {
Error YAMLErr = writeIFSToOutputStream(OutStr, Stub);
if (YAMLErr)
return YAMLErr;
OutStr.flush();

if (WriteIfChanged) {
if (ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrError =
Expand Down
2 changes: 0 additions & 2 deletions llvm/tools/llvm-lipo/llvm-lipo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ static const StringRef ToolName = "llvm-lipo";
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(std::move(E), OS);
OS.flush();
reportError(Buf);
}

Expand All @@ -58,7 +57,6 @@ static const StringRef ToolName = "llvm-lipo";
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(std::move(E), OS);
OS.flush();
WithColor::error(errs(), ToolName) << "'" << File << "': " << Buf;
exit(EXIT_FAILURE);
}
Expand Down
2 changes: 0 additions & 2 deletions llvm/tools/llvm-mca/Views/DispatchStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ void DispatchStatistics::printDispatchHistogram(raw_ostream &OS) const {
<< "%)\n";
}

TempStream.flush();
OS << Buffer;
}

Expand Down Expand Up @@ -79,7 +78,6 @@ void DispatchStatistics::printDispatchStalls(raw_ostream &OS) const {
SS << "\nUSH - Uncategorised Structural Hazard: ";
printStalls(SS, HWStalls[HWStallEvent::CustomBehaviourStall], NumCycles);
SS << '\n';
SS.flush();
OS << Buffer;
}

Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-mca/llvm-mca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ int main(int argc, char **argv) {
<< ", use -skip-unsupported-instructions=lack-sched to "
"ignore these on the input.\n";
IP->printInst(&IE.Inst, 0, "", *STI, SS);
SS.flush();
WithColor::note()
<< "instruction: " << InstructionStr << '\n';
})) {
Expand Down
3 changes: 0 additions & 3 deletions llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ static int printLineInfoForInput(bool LoadObjects, bool UseDebugObj) {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}

Expand Down Expand Up @@ -570,7 +569,6 @@ static int executeInput() {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}

Expand Down Expand Up @@ -975,7 +973,6 @@ static int linkAndVerify() {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}

Expand Down
2 changes: 0 additions & 2 deletions llvm/tools/llvm-size/llvm-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ static void error(llvm::Error E, StringRef FileName, const Archive::Child &C,
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << ": " << Buf << "\n";
}

Expand All @@ -139,7 +138,6 @@ static void error(llvm::Error E, StringRef FileName,
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << ": " << Buf << "\n";
}

Expand Down
Loading