@@ -388,7 +388,8 @@ void LinkerDriver::addLibrary(StringRef name) {
388
388
if (std::optional<std::string> path = searchLibrary (ctx, name))
389
389
addFile (saver ().save (*path), /* withLOption=*/ true );
390
390
else
391
- error (" unable to find library -l" + name, ErrorTag::LibNotFound, {name});
391
+ ctx.errHandler ->error (" unable to find library -l" + name,
392
+ ErrorTag::LibNotFound, {name});
392
393
}
393
394
394
395
// This function is called on startup. We need this for LTO since
@@ -642,11 +643,11 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
642
643
opt::InputArgList args = parser.parse (ctx, argsArr.slice (1 ));
643
644
644
645
// Interpret these flags early because Err/Warn depend on them.
645
- errorHandler (). errorLimit = args::getInteger (args, OPT_error_limit, 20 );
646
- errorHandler (). fatalWarnings =
646
+ ctx. errHandler -> errorLimit = args::getInteger (args, OPT_error_limit, 20 );
647
+ ctx. errHandler -> fatalWarnings =
647
648
args.hasFlag (OPT_fatal_warnings, OPT_no_fatal_warnings, false ) &&
648
649
!args.hasArg (OPT_no_warnings);
649
- errorHandler (). suppressWarnings = args.hasArg (OPT_no_warnings);
650
+ ctx. errHandler -> suppressWarnings = args.hasArg (OPT_no_warnings);
650
651
651
652
// Handle -help
652
653
if (args.hasArg (OPT_help)) {
@@ -1278,8 +1279,8 @@ static bool remapInputs(Ctx &ctx, StringRef line, const Twine &location) {
1278
1279
1279
1280
// Initializes Config members by the command line options.
1280
1281
static void readConfigs (Ctx &ctx, opt::InputArgList &args) {
1281
- errorHandler (). verbose = args.hasArg (OPT_verbose);
1282
- errorHandler (). vsDiagnostics =
1282
+ ctx. errHandler -> verbose = args.hasArg (OPT_verbose);
1283
+ ctx. errHandler -> vsDiagnostics =
1283
1284
args.hasArg (OPT_visual_studio_diagnostics_format, false );
1284
1285
1285
1286
ctx.arg .allowMultipleDefinition =
@@ -1337,7 +1338,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
1337
1338
args.hasArg (OPT_enable_non_contiguous_regions);
1338
1339
ctx.arg .entry = args.getLastArgValue (OPT_entry);
1339
1340
1340
- errorHandler (). errorHandlingScript =
1341
+ ctx. errHandler -> errorHandlingScript =
1341
1342
args.getLastArgValue (OPT_error_handling_script);
1342
1343
1343
1344
ctx.arg .executeOnly =
0 commit comments