Skip to content

Commit 998bf33

Browse files
committed
[NFC][LLVM] Override and deprecate raw_string_ostream::flush
1 parent 0833b48 commit 998bf33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2
-116
lines changed

llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,6 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
18131813

18141814
raw_string_ostream OS(Result);
18151815
OS << "color=\"red\"";
1816-
OS.flush();
18171816
return Result;
18181817
}
18191818

@@ -1872,8 +1871,6 @@ struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
18721871
OS << ",color=\"red\"";
18731872
}
18741873
}
1875-
1876-
OS.flush();
18771874
return Str;
18781875
}
18791876
};

llvm/include/llvm/Analysis/LazyCallGraph.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ class LazyCallGraph {
513513
std::string Name;
514514
raw_string_ostream OS(Name);
515515
OS << *this;
516-
OS.flush();
517516
return Name;
518517
}
519518
};
@@ -654,7 +653,6 @@ class LazyCallGraph {
654653
std::string Name;
655654
raw_string_ostream OS(Name);
656655
OS << *this;
657-
OS.flush();
658656
return Name;
659657
}
660658

llvm/include/llvm/Support/FormatVariadic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class formatv_object_base {
105105
std::string Result;
106106
raw_string_ostream Stream(Result);
107107
Stream << *this;
108-
Stream.flush();
109108
return Result;
110109
}
111110

llvm/include/llvm/Support/InterleavedRange.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ template <typename Range> class InterleavedRange {
5656
std::string Result;
5757
raw_string_ostream Stream(Result);
5858
Stream << *this;
59-
Stream.flush();
6059
return Result;
6160
}
6261

llvm/include/llvm/Support/raw_ostream.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ class LLVM_ABI raw_string_ostream : public raw_ostream {
682682
void reserveExtraSpace(uint64_t ExtraSize) override {
683683
OS.reserve(tell() + ExtraSize);
684684
}
685+
686+
// void flush() = delete;
685687
};
686688

687689
/// A raw_ostream that writes to an SmallVector or SmallString. This is a

llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ void ImportedFunctionsInliningStatistics::dump(const bool Verbose) {
167167
"non-imported functions inlined into importing module",
168168
InlinedNotImportedFunctionsToImportingModuleCount,
169169
NotImportedFuncCount, "non-imported functions");
170-
Ostream.flush();
171170
dbgs() << Out;
172171
}
173172

llvm/lib/CodeGen/MIRCanonicalizerPass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ rescheduleLexographically(std::vector<MachineInstr *> instructions,
9696
std::string S;
9797
raw_string_ostream OS(S);
9898
II->print(OS);
99-
OS.flush();
10099

101100
// Trim the assignment, or start from the beginning in the case of a store.
102101
const size_t i = S.find('=');

llvm/lib/CodeGen/MachineBlockPlacement.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ static std::string getBlockName(const MachineBasicBlock *BB) {
700700
raw_string_ostream OS(Result);
701701
OS << printMBBReference(*BB);
702702
OS << " ('" << BB->getName() << "')";
703-
OS.flush();
704703
return Result;
705704
}
706705
#endif

llvm/lib/CodeGen/ModuloSchedule.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,6 @@ void PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander() {
20332033
std::string ScheduleDump;
20342034
raw_string_ostream OS(ScheduleDump);
20352035
Schedule.print(OS);
2036-
OS.flush();
20372036

20382037
// First, run the normal ModuleScheduleExpander. We don't support any
20392038
// InstrChanges.

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,6 @@ void TargetLoweringObjectFileCOFF::emitLinkerDirectives(
19531953
raw_string_ostream OS(Flags);
19541954
emitLinkerFlagsForGlobalCOFF(OS, &GV, getContext().getTargetTriple(),
19551955
getMangler());
1956-
OS.flush();
19571956
if (!Flags.empty()) {
19581957
Streamer.switchSection(getDrectveSection());
19591958
Streamer.emitBytes(Flags);
@@ -1978,7 +1977,6 @@ void TargetLoweringObjectFileCOFF::emitLinkerDirectives(
19781977
raw_string_ostream OS(Flags);
19791978
emitLinkerFlagsForUsedCOFF(OS, GV, getContext().getTargetTriple(),
19801979
getMangler());
1981-
OS.flush();
19821980

19831981
if (!Flags.empty()) {
19841982
Streamer.switchSection(getDrectveSection());

0 commit comments

Comments
 (0)