[COFF] Initalize ErrorHandler with CanExitEarly value

Previously, the COFF driver would call exit(1) from the
ErrorHandler in the case of a link error, even if
CanExitEarly=false was specified. Now it initializes
the ErrorHandler in the same way that the ELF driver does.

Patch by Andrew Kelley.

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

llvm-svn: 321983
This commit is contained in:
Shoaib Meenai 2018-01-08 05:58:36 +00:00
parent 3a15fb591e
commit fd3e4b0ea1
1 changed files with 1 additions and 0 deletions

View File

@ -57,6 +57,7 @@ bool link(ArrayRef<const char *> Args, bool CanExitEarly, raw_ostream &Diag) {
errorHandler().ErrorLimitExceededMsg =
"too many errors emitted, stopping now"
" (use /ERRORLIMIT:0 to see all errors)";
errorHandler().ExitEarly = CanExitEarly;
Config = make<Configuration>();
Config->Argv = {Args.begin(), Args.end()};
Config->CanExitEarly = CanExitEarly;