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

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

Expand Down Expand Up @@ -1872,8 +1871,6 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
OS << ",color=\"red\"";
}
}

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 @@ -513,7 +513,6 @@ class LazyCallGraph {
std::string Name;
raw_string_ostream OS(Name);
OS << *this;
OS.flush();
return Name;
}
};
Expand Down Expand Up @@ -654,7 +653,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 @@ -105,7 +105,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/include/llvm/Support/InterleavedRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ template <typename Range> class InterleavedRange {
std::string Result;
raw_string_ostream Stream(Result);
Stream << *this;
Stream.flush();
return Result;
}

Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/Support/raw_ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ class LLVM_ABI raw_string_ostream : public raw_ostream {
void reserveExtraSpace(uint64_t ExtraSize) override {
OS.reserve(tell() + ExtraSize);
}

// void flush() = delete;
};

/// A raw_ostream that writes to an SmallVector or SmallString. This is a
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ void ImportedFunctionsInliningStatistics::dump(const bool Verbose) {
"non-imported functions inlined into importing module",
InlinedNotImportedFunctionsToImportingModuleCount,
NotImportedFuncCount, "non-imported functions");
Ostream.flush();
dbgs() << Out;
}

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ rescheduleLexographically(std::vector<MachineInstr *> instructions,
std::string S;
raw_string_ostream OS(S);
II->print(OS);
OS.flush();

// Trim the assignment, or start from the beginning in the case of a store.
const size_t i = S.find('=');
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/MachineBlockPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ static std::string getBlockName(const MachineBasicBlock *BB) {
raw_string_ostream OS(Result);
OS << printMBBReference(*BB);
OS << " ('" << BB->getName() << "')";
OS.flush();
return Result;
}
#endif
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/ModuloSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,6 @@ void PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander() {
std::string ScheduleDump;
raw_string_ostream OS(ScheduleDump);
Schedule.print(OS);
OS.flush();

// First, run the normal ModuleScheduleExpander. We don't support any
// InstrChanges.
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,6 @@ void TargetLoweringObjectFileCOFF::emitLinkerDirectives(
raw_string_ostream OS(Flags);
emitLinkerFlagsForGlobalCOFF(OS, &GV, getContext().getTargetTriple(),
getMangler());
OS.flush();
if (!Flags.empty()) {
Streamer.switchSection(getDrectveSection());
Streamer.emitBytes(Flags);
Expand All @@ -1978,7 +1977,6 @@ void TargetLoweringObjectFileCOFF::emitLinkerDirectives(
raw_string_ostream OS(Flags);
emitLinkerFlagsForUsedCOFF(OS, GV, getContext().getTargetTriple(),
getMangler());
OS.flush();

if (!Flags.empty()) {
Streamer.switchSection(getDrectveSection());
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 @@ -234,7 +234,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
1 change: 0 additions & 1 deletion llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ llvm::Error GsymCreator::saveSegments(StringRef Path,
std::optional<uint64_t> FirstFuncAddr = GC->getFirstFunctionAddress();
if (FirstFuncAddr) {
SGP << Path << "-" << llvm::format_hex(*FirstFuncAddr, 1);
SGP.flush();
Err = GC->save(SegmentedGsymPath, ByteOrder, std::nullopt);
if (Err)
return Err;
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 @@ -544,7 +544,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 @@ -660,7 +659,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
OS << getModRefStr(MR);
}
OS << ")";
OS.flush();
return Result;
}

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

Expand All @@ -697,7 +694,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 @@ -651,8 +649,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 @@ -417,7 +417,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 @@ -227,7 +227,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 @@ -266,7 +265,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
1 change: 0 additions & 1 deletion llvm/lib/LTO/LTOCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI) {
raw_string_ostream Stream(MsgStorage);
DiagnosticPrinterRawOStream DP(Stream);
DI.print(DP);
Stream.flush();

// If this method has been called it means someone has set up an external
// diagnostic handler. Assert on that.
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 @@ -110,7 +110,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 @@ -281,7 +280,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 @@ -320,7 +318,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 @@ -317,7 +317,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 @@ -341,7 +340,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 @@ -1257,7 +1257,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 @@ -545,7 +544,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 @@ -653,8 +651,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 @@ -682,7 +678,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/lib/Support/Chrono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ static void format(const T &Fractional, struct tm &LT, raw_ostream &OS,
}
FStream << Style[I];
}
FStream.flush();
char Buffer[256]; // Should be enough for anywhen.
size_t Len = strftime(Buffer, sizeof(Buffer), Format.c_str(), &LT);
OS << (Len ? Buffer : "BAD-DATE-FORMAT");
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 @@ -572,7 +572,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-cov/TestingSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ int convertForTestingMain(int argc, const char *argv[]) {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(ObjErr.takeError(), OS);
OS.flush();
errs() << "error: " << Buf;
return 1;
}
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ static void dumpArchive(const Archive *Arc) {
std::string Buf;
raw_string_ostream OS(Buf);
logAllUnhandledErrors(std::move(E), OS);
OS.flush();
reportError(Arc->getFileName(), Buf);
}
consumeError(ChildOrErr.takeError());
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ template <> struct MappingContextTraits<exegesis::Benchmark, YamlContext> {
std::string Str;
raw_string_ostream OSS(Str);
Binary.writeAsBinary(OSS);
OSS.flush();
Data.assign(Str.begin(), Str.end());
return Data;
}
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 @@ -260,7 +260,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-ir2vec/llvm-ir2vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ class IR2VecTool {
MaxRelation = std::max(MaxRelation, FuncMaxRelation);
}

RelOS.flush();

// Write metadata header followed by relationships
OS << "MAX_RELATION=" << MaxRelation << '\n';
OS << Relationships;
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ checkForDuplicates(const MembersPerArchitectureMap &MembersPerArch) {
}
}

ErrorStream.flush();
if (ErrorData.size() > 0)
return createStringError(std::errc::invalid_argument, ErrorData.c_str());
}
Expand Down
Loading
Loading