[lld] r185657 - Don't pass llvm::errs() all over the place. Diagnostics always go to stderr.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jul 4 19:43:23 PDT 2013


On 4 July 2013 21:47, Nick Kledzik <kledzik at apple.com> wrote:
> This seems worse off.  If lld was strictly a command line tool, I can see just just writing to stderr everywhere would be fine.  But we want lld to be a library too.  And the clients of the library will want better control over where diagnostics go.  In addition, if multiple things are being linked in parallel, the client could create a separate ostream for each parallel instance.  By forcing all instances to use the same (stderr) stream, the errors will be intermixed.

It is a library, just like llvm and clang. Those are valid uses, but
until we actually have someone using them, we should do like llvm and
clang and have the simpler interface. I did grep llvm and clang and
using llvm::errs() is by far the more common pattern.

> -Nick

Cheers,
Rafael




More information about the llvm-commits mailing list