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

Nick Kledzik kledzik at apple.com
Fri Jul 5 13:38:46 PDT 2013


On Jul 4, 2013, at 7:43 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:

> 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.

There are unittests in lld that run invoke the Drivers with raw_string_ostreams and parse the string to check that the correct error was generated.  This change breaks those tests. 

I just recently noticed that those unittests are not being built and run as part of the lld-test target.  I’m still trying to figure out why.

-Nick






More information about the llvm-commits mailing list