[all-commits] [llvm/llvm-project] dcd616: utils: Remove some no-op raw_string_ostream flush ...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Fri Dec 10 11:27:50 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7
      https://github.com/llvm/llvm-project/commit/dcd6162b7fd5108a5fbf2fb29d870cb4255eb9c7
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-12-10 (Fri, 10 Dec 2021)

  Changed paths:
    M llvm/utils/FileCheck/FileCheck.cpp
    M llvm/utils/TableGen/AsmWriterEmitter.cpp
    M llvm/utils/TableGen/CodeEmitterGen.cpp
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp
    M llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
    M llvm/utils/TableGen/DAGISelMatcherGen.cpp
    M llvm/utils/TableGen/FastISelEmitter.cpp
    M llvm/utils/TableGen/GICombinerEmitter.cpp
    M llvm/utils/TableGen/GlobalISelEmitter.cpp
    M llvm/utils/TableGen/PredicateExpander.cpp
    M llvm/utils/TableGen/SubtargetEmitter.cpp
    M llvm/utils/yaml-bench/YAMLBench.cpp

  Log Message:
  -----------
  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.




More information about the All-commits mailing list