Skip to content

Commit 0a5edb4

Browse files
committed
[bolt] Don't call llvm::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 9ac00b8 commit 0a5edb4

File tree

5 files changed

+0
-7
lines changed

5 files changed

+0
-7
lines changed

bolt/include/bolt/Core/BinaryData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ inline raw_ostream &operator<<(raw_ostream &OS,
226226
Sep = ",\n ";
227227
TotalCount += AccessInfo.Count;
228228
}
229-
SS.flush();
230229

231230
OS << TotalCount << " total counts : " << TempString;
232231
return OS;

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ inline raw_ostream &operator<<(raw_ostream &OS,
117117
TotalCount += CSP.Count;
118118
TotalMispreds += CSP.Mispreds;
119119
}
120-
SS.flush();
121120

122121
OS << TotalCount << " (" << TotalMispreds << " misses) :" << TempString;
123122
return OS;

bolt/lib/Passes/RetpolineInsertion.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ std::string createRetpolineFunctionTag(BinaryContext &BC,
181181
if (BrInfo.isReg()) {
182182
BC.InstPrinter->printRegName(TagOS, BrInfo.BranchReg);
183183
TagOS << "_";
184-
TagOS.flush();
185184
return Tag;
186185
}
187186

@@ -212,7 +211,6 @@ std::string createRetpolineFunctionTag(BinaryContext &BC,
212211
BC.InstPrinter->printRegName(TagOS, MemRef.SegRegNum);
213212
}
214213

215-
TagOS.flush();
216214
return Tag;
217215
}
218216

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4245,7 +4245,6 @@ void RewriteInstance::addBoltInfoSection() {
42454245
<< "command line:";
42464246
for (int I = 0; I < Argc; ++I)
42474247
DescOS << " " << Argv[I];
4248-
DescOS.flush();
42494248

42504249
// Encode as GNU GOLD VERSION so it is easily printable by 'readelf -n'
42514250
const std::string BoltInfo =
@@ -4268,7 +4267,6 @@ void RewriteInstance::encodeBATSection() {
42684267
raw_string_ostream DescOS(DescStr);
42694268

42704269
BAT->write(*BC, DescOS);
4271-
DescOS.flush();
42724270

42734271
const std::string BoltInfo =
42744272
BinarySection::encodeELFNote("BOLT", DescStr, BinarySection::NT_BOLT_BAT);

bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ std::string InstrumentationRuntimeLibrary::buildTables(BinaryContext &BC) {
314314
}
315315
// Our string table lives immediately after descriptions vector
316316
OS << Summary->StringTable;
317-
OS.flush();
318317

319318
return TablesStr;
320319
}

0 commit comments

Comments
 (0)