diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-12-09 18:57:38 -0800 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-12-10 11:26:08 -0800 |
| commit | dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7 (patch) | |
| tree | f0ad72a7c0f6f544cd8cf48023afdc3d780350c3 /llvm/utils/TableGen/CodeEmitterGen.cpp | |
| parent | 04f2712ef4e4d154f8b4d94db8020a901dbf22ff (diff) | |
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/TableGen/CodeEmitterGen.cpp')
| -rw-r--r-- | llvm/utils/TableGen/CodeEmitterGen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeEmitterGen.cpp b/llvm/utils/TableGen/CodeEmitterGen.cpp index ee77ef5eda5f..fbac0d969917 100644 --- a/llvm/utils/TableGen/CodeEmitterGen.cpp +++ b/llvm/utils/TableGen/CodeEmitterGen.cpp @@ -515,7 +515,7 @@ void CodeEmitterGen::run(raw_ostream &o) { << " std::string msg;\n" << " raw_string_ostream Msg(msg);\n" << " Msg << \"Not supported instr: \" << MI;\n" - << " report_fatal_error(Msg.str().c_str());\n" + << " report_fatal_error(msg.c_str());\n" << " }\n"; if (UseAPInt) o << " Inst = Value;\n"; |
