summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Error.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lld] unified COFF and ELF error handling on new Common/ErrorHandlerBob Haarman2017-10-251-120/+0
| | | | | | | | | | | | | | | | | | | Summary: The COFF linker and the ELF linker have long had similar but separate Error.h and Error.cpp files to implement error handling. This change introduces new error handling code in Common/ErrorHandler.h, changes the COFF and ELF linkers to use it, and removes the old, separate implementations. Reviewers: ruiu Reviewed By: ruiu Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D39259 llvm-svn: 316624
* [COFF] Add support for /WXShoaib Meenai2017-10-241-0/+5
| | | | | | | | | link.exe supports this option to convert warnings into errors, and it's useful to support in LLD as well. Differential Revision: https://reviews.llvm.org/D39148 llvm-svn: 316502
* lld::COFF: better behavior when using as a libraryRui Ueyama2017-10-231-2/+3
| | | | | | | | | | | | | | | Previously, the COFF driver would call exit(0) when called as a library. Now it takes `ExitEarly` option, and if it is false, it doesn't exit. So it is now more library-friendly. Furthermore, link() calls freeArena() before returning, to clean up resources. Based on an Andrew Kelley's patch. Differential Revision: https://reviews.llvm.org/D39202 llvm-svn: 316370
* [lld/pdb] Add some basic linker module symbols.Zachary Turner2017-07-101-3/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D35152 llvm-svn: 307590
* Flush output in log()Hans Wennborg2017-04-281-0/+1
| | | | | | | | This change was motivated by output from lld-link.exe and link.exe getting intermixed. There's already a flush() call in message(), so there's precedence. llvm-svn: 301693
* [COFF] support /ERRORLIMIT optionBob Haarman2017-04-051-1/+1
| | | | | | | | | | | | | | | | | Summary: This adds support for reporting multiple errors in a single invocation of lld-link. The limit defaults to 20 and can be changed with the /ERRORLIMIT command line parameter, or set to unlimited by passing a value of 0. This is a new attempt after r295507, which was reverted because opening files raced with exiting early, causing the test to be flaky. This version avoids the race by exiting before calling enqueuePath. Reviewers: pcc, ruiu Reviewed By: ruiu Subscribers: llvm-commits, dblaikie Differential Revision: https://reviews.llvm.org/D31688 llvm-svn: 299496
* Do not use errs() or outs() directly. Instead use message(), log() or error()Rui Ueyama2017-02-211-0/+13
| | | | | | | | | LLD is a multi-threaded program. errs() or outs() are not guaranteed to be thread-safe (they are actually not). LLD's message(), log() or error() are thread-safe. We should use them. llvm-svn: 295787
* Revert "[COFF] support /ERRORLIMIT option"David Blaikie2017-02-191-2/+1
| | | | | | | | | | | | | Behavior races on ErrorCount. If the enqueued paths are evaluated eagerly (in enqueuePath) then the behavior is as the test expects. But they may not be evaluated until the future is waited on, in run() - which is after the early return/exit on ErrorCount. (this causes the test to fail (because in the "/ERRORCOUNT:XYZ" test, no other errors are printed), at least for me, on linux) This reverts commit r295507. llvm-svn: 295590
* [COFF] support /ERRORLIMIT optionBob Haarman2017-02-171-1/+2
| | | | | | | | | | | | Summary: This adds support for reporting multiple errors in a single invocation of lld-link. The limit defaults to 20 and can be changed with the /ERRORLIMIT command line parameter, or set to unlimited by passing a value of 0. Reviewers: pcc, ruiu Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D29691 llvm-svn: 295507
* COFF: add error() and warn() to Error.{cpp,h}Bob Haarman2017-01-171-5/+56
| | | | | | | | | | | | Summary: This copies over some functionality we have in ELF/Error.{cpp,h} and makes it available in COFF/Error.{cpp,h} Reviewers: pcc, rafael, ruiu Subscribers: Differential Revision: https://reviews.llvm.org/D28692 llvm-svn: 292240
* Start using make() in COFF (with a smaller change.)Rui Ueyama2016-12-081-2/+8
| | | | llvm-svn: 289089
* Revert r289084: Start using make() in COFF.Rui Ueyama2016-12-081-8/+1
| | | | | | This reverts commit r289084 to appease buildbots. llvm-svn: 289086
* Start using make() in COFF.Rui Ueyama2016-12-081-1/+8
| | | | | | We don't want ELF and COFF to diverge too much. llvm-svn: 289085
* Print error message header in red.Rui Ueyama2016-11-291-1/+12
| | | | llvm-svn: 288110
* COFF: Remove `void error()` functions and use fatal instead.Rui Ueyama2016-07-151-10/+5
| | | | | | This change makes the control flow more explicit. llvm-svn: 275504
* COFF: Rename noreturn error -> fatal.Rui Ueyama2016-07-141-3/+3
| | | | | | This new name is also consistent with ELF. llvm-svn: 275500
* COFF: Rename non-noreturn error -> check.Rui Ueyama2016-07-141-2/+2
| | | | | | The new name is consistent with ELF. llvm-svn: 275499
* COFF: Switch to new archive writer interface (D21721).Peter Collingbourne2016-06-291-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D21722 llvm-svn: 274184
* Port the error functions from ELF to COFF.Rafael Espindola2015-08-061-0/+30
This has a few advantages * Less C++ code (about 300 lines less). * Less machine code (about 14 KB of text on a linux x86_64 build). * It is more debugger friendly. Just set a breakpoint on the exit function and you get the complete lld stack trace of when the error was found. * It is a more robust API. The errors are handled early and we don't get a std::error_code hot potato being passed around. * In most cases the error function in a better position to print diagnostics (it has more context). llvm-svn: 244215
OpenPOWER on IntegriCloud