[all-commits] [llvm/llvm-project] a2fe81: [clang] NFC: Use flush() idiomatically

Kirill Bobyrev via All-commits all-commits at lists.llvm.org
Wed Jan 26 09:25:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2fe81f32c3a2772e49cb5555d5978db4e5812a3
      https://github.com/llvm/llvm-project/commit/a2fe81f32c3a2772e49cb5555d5978db4e5812a3
  Author: Kirill Bobyrev <kbobyrev at google.com>
  Date:   2022-01-26 (Wed, 26 Jan 2022)

  Changed paths:
    M clang/lib/AST/DeclPrinter.cpp

  Log Message:
  -----------
  [clang] NFC: Use flush() idiomatically

Using both `raw_ostream::flush()` and `raw_ostream::str()` consecutively is
redundant. The alternatives are:

- Use `raw_ostream::str()` without `raw_ostream::flush()`
- Use `raw_ostream::flush()` and then use the destination for `raw_ostream`
  writer

The latter is more idiomatic, so the fix resolves this particular case in its
favor.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D118247




More information about the All-commits mailing list