[all-commits] [llvm/llvm-project] 5730d1: [lld-link] Consistently print all /verbose output ...

Nico Weber via All-commits all-commits at lists.llvm.org
Wed Jan 5 08:52:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5730d11c2b52b769eefee540932606cb4ab3c5f6
      https://github.com/llvm/llvm-project/commit/5730d11c2b52b769eefee540932606cb4ab3c5f6
  Author: Nico Weber <thakis at chromium.org>
  Date:   2022-01-05 (Wed, 05 Jan 2022)

  Changed paths:
    M lld/COFF/Chunks.cpp

  Log Message:
  -----------
  [lld-link] Consistently print all /verbose output to stderr

lld-link used to consistently print all /verbose output to stdout, and that was
an intentional decision: https://reviews.llvm.org/rG4bce7bcc88f3

https://reviews.llvm.org/rGe6e206d4b4814 added message() and log(),
and back then `log()` morally was just `if (verbose) message(...)`
and message() wrote to stdout.

So that change moved most /verbose-induced writes to outs() to
log(). Except for the one in printDiscardedMessage(), since
the check for `verbose` for that one is in the caller, in
Writer::createSections():

    if (config->verbose)
      sc->printDiscardedMessage();

Later, https://reviews.llvm.org/D41033 changed log() to write to
stderr. That moved lld-link from writing all its /verbose output
to stdout to writing almost all of its /verbose output to stderr --
except for printDiscardedMessage() output.

This change moves printDiscardedMessage() to call log() as well,
so that all /verbose output once again consistently goes to the same
stream.

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




More information about the All-commits mailing list