@@ -858,21 +858,22 @@ COFFOptTable::COFFOptTable() : GenericOptTable(infoTable, true) {}
858
858
859
859
// Set color diagnostics according to --color-diagnostics={auto,always,never}
860
860
// or --no-color-diagnostics flags.
861
- static void handleColorDiagnostics (opt::InputArgList &args) {
861
+ static void handleColorDiagnostics (COFFLinkerContext &ctx,
862
+ opt::InputArgList &args) {
862
863
auto *arg = args.getLastArg (OPT_color_diagnostics, OPT_color_diagnostics_eq,
863
864
OPT_no_color_diagnostics);
864
865
if (!arg)
865
866
return ;
866
867
if (arg->getOption ().getID () == OPT_color_diagnostics) {
867
- lld:: errs ().enable_colors (true );
868
+ ctx. e . errs ().enable_colors (true );
868
869
} else if (arg->getOption ().getID () == OPT_no_color_diagnostics) {
869
- lld:: errs ().enable_colors (false );
870
+ ctx. e . errs ().enable_colors (false );
870
871
} else {
871
872
StringRef s = arg->getValue ();
872
873
if (s == " always" )
873
- lld:: errs ().enable_colors (true );
874
+ ctx. e . errs ().enable_colors (true );
874
875
else if (s == " never" )
875
- lld:: errs ().enable_colors (false );
876
+ ctx. e . errs ().enable_colors (false );
876
877
else if (s != " auto" )
877
878
error (" unknown option: --color-diagnostics=" + s);
878
879
}
@@ -939,7 +940,7 @@ opt::InputArgList ArgParser::parse(ArrayRef<const char *> argv) {
939
940
if (missingCount)
940
941
fatal (Twine (args.getArgString (missingIndex)) + " : missing argument" );
941
942
942
- handleColorDiagnostics (args);
943
+ handleColorDiagnostics (ctx, args);
943
944
944
945
for (opt::Arg *arg : args.filtered (OPT_UNKNOWN)) {
945
946
std::string nearest;
0 commit comments