Add -debug-diagnostic-names frontend flag

This flag adds diagnostic names to the end of their messages, e.g. 'error: cannot convert value of type '[Any]' to specified type '[Int]' [cannot_convert_initializer_value]'. It's intended to be used for debugging purposes when working on the compiler.
This commit is contained in:
Owen Voorhees
2019-08-03 19:11:26 -07:00
parent e6ae7867bf
commit e7a1a1cc3d
9 changed files with 73 additions and 6 deletions

View File

@@ -669,6 +669,7 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Opts.FixitCodeForAllDiagnostics |= Args.hasArg(OPT_fixit_all);
Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings);
Opts.WarningsAsErrors |= Args.hasArg(OPT_warnings_as_errors);
Opts.PrintDiagnosticNames |= Args.hasArg(OPT_debug_diagnostic_names);
assert(!(Opts.WarningsAsErrors && Opts.SuppressWarnings) &&
"conflicting arguments; should have been caught by driver");