aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-12-09 18:57:38 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-12-10 11:26:08 -0800
commitdcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7 (patch)
treef0ad72a7c0f6f544cd8cf48023afdc3d780350c3 /llvm/utils/FileCheck/FileCheck.cpp
parent04f2712ef4e4d154f8b4d94db8020a901dbf22ff (diff)
downloadllvm-dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7.zip
llvm-dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7.tar.gz
llvm-dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7.tar.bz2
utils: Remove some no-op raw_string_ostream flush calls, NFC
Since 65b13610a5226b84889b923bae884ba395ad084d, raw_string_ostream has been unbuffered by default. Based on an audit of llvm/utils/, this commit removes every call to `raw_string_ostream::flush()` and any call to `raw_string_ostream::str()` whose result is ignored or that doesn't help with clarity. I left behind a few calls to `str()`. In these cases, the underlying std::string was declared pretty far away and never used again, whereas stream recently had its last write. The code is easier to read as-is; the no-op call to `flush()` inside `str()` isn't harmful, and when https://reviews.llvm.org/D115421 lands it'll be gone anyway.
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 4dcc481..6742853 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -415,7 +415,6 @@ BuildInputAnnotations(const SourceMgr &SM, unsigned CheckFileBufferID,
"the check file or for an implicit pattern");
if (DiagCountPerPattern[DiagItr->CheckLoc] > 1)
Label << "'" << DiagIndexPerPattern[DiagItr->CheckLoc]++;
- Label.flush();
LabelWidth = std::max((std::string::size_type)LabelWidth, A.Label.size());
A.Marker = GetMarker(DiagItr->MatchTy);