Loading lld/Common/ErrorHandler.cpp +22 −13 Original line number Diff line number Diff line Loading @@ -62,8 +62,11 @@ void lld::exitLld(int val) { // avoid intermittent crashes on Windows when exiting. llvm_shutdown(); { std::lock_guard<std::mutex> lock(mu); lld::outs().flush(); lld::errs().flush(); } _exit(val); } Loading Loading @@ -191,6 +194,8 @@ void ErrorHandler::error(const Twine &msg) { } } bool exit = false; { std::lock_guard<std::mutex> lock(mu); if (errorLimit == 0 || errorCount < errorLimit) { Loading @@ -198,15 +203,19 @@ void ErrorHandler::error(const Twine &msg) { << "error: " << Colors::RESET << msg << "\n"; } else if (errorCount == errorLimit) { lld::errs() << sep << getLocation(msg) << ": " << Colors::RED << "error: " << Colors::RESET << errorLimitExceededMsg << "\n"; if (exitEarly) exitLld(1); << "error: " << Colors::RESET << errorLimitExceededMsg << "\n"; exit = exitEarly; } sep = getSeparator(msg); ++errorCount; } if (exit) exitLld(1); } void ErrorHandler::fatal(const Twine &msg) { error(msg); exitLld(1); Loading Loading
lld/Common/ErrorHandler.cpp +22 −13 Original line number Diff line number Diff line Loading @@ -62,8 +62,11 @@ void lld::exitLld(int val) { // avoid intermittent crashes on Windows when exiting. llvm_shutdown(); { std::lock_guard<std::mutex> lock(mu); lld::outs().flush(); lld::errs().flush(); } _exit(val); } Loading Loading @@ -191,6 +194,8 @@ void ErrorHandler::error(const Twine &msg) { } } bool exit = false; { std::lock_guard<std::mutex> lock(mu); if (errorLimit == 0 || errorCount < errorLimit) { Loading @@ -198,15 +203,19 @@ void ErrorHandler::error(const Twine &msg) { << "error: " << Colors::RESET << msg << "\n"; } else if (errorCount == errorLimit) { lld::errs() << sep << getLocation(msg) << ": " << Colors::RED << "error: " << Colors::RESET << errorLimitExceededMsg << "\n"; if (exitEarly) exitLld(1); << "error: " << Colors::RESET << errorLimitExceededMsg << "\n"; exit = exitEarly; } sep = getSeparator(msg); ++errorCount; } if (exit) exitLld(1); } void ErrorHandler::fatal(const Twine &msg) { error(msg); exitLld(1); Loading