Add an opt-in warning to complain about needless words in declarations.

The new option -Womit-needless-words finds places where names are
redundant with type information, producing warnings and Fix-Its to
shorten the names. Part of rdar://problem/22232287, to help bring
the same heuristics we're applying in the Clang importer to the user's
Swift code.

Swift SVN r31234
This commit is contained in:
Doug Gregor
2015-08-13 23:39:35 +00:00
parent c02cd1a424
commit 561d5fd4a9
8 changed files with 218 additions and 1 deletions

View File

@@ -669,6 +669,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (Opts.DebuggerSupport)
Opts.EnableDollarIdentifiers = true;
Opts.Playground |= Args.hasArg(OPT_playground);
Opts.WarnOmitNeedlessWords = Args.hasArg(OPT_warn_omit_needless_words);
Opts.EnableThrowWithoutTry |= Args.hasArg(OPT_enable_throw_without_try);