From: Ted Kremenek Date: Thu, 30 Aug 2012 05:49:16 +0000 (+0000) Subject: Change -analyzer-config to use '=' as the key-value separator, and only X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=318cc3c07eaca04d319be841e9e3bac35d1ff9f5;p=clang Change -analyzer-config to use '=' as the key-value separator, and only support the '-analyzer-config key=val' variant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162891 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index 724a9a813b..e0a89a1cc3 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -145,5 +145,5 @@ def note_drv_command_failed_diag_msg : Note< def err_analyzer_config_no_value : Error< "analyzer-config option '%0' has a key but no value">; def err_analyzer_config_multiple_values : Error< - "analyzer-config option '%0' should contain only one ':'">; + "analyzer-config option '%0' should contain only one '='">; } diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 9213d217ef..53bbfa4ed2 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -120,9 +120,7 @@ def analyzer_checker_help : Flag<"-analyzer-checker-help">, HelpText<"Display the list of analyzer checkers that are available">; def analyzer_config : Separate<"-analyzer-config">, - HelpText<"Choose analyzer checkers to enable">; -def analyzer_config_EQ : Joined<"-analyzer-config=">, - Alias; + HelpText<"Choose analyzer options to enable">; //===----------------------------------------------------------------------===// // Migrator Options diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 8935e775a7..6f6ef42c6f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1161,20 +1161,20 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, const Arg *A = *it; A->claim(); // We can have a list of comma separated config names, e.g: - // '-analyzer-config=key1:val1,key2:val2' + // '-analyzer-config key1=val1,key2=val2' StringRef configList = A->getValue(Args); SmallVector configVals; configList.split(configVals, ","); for (unsigned i = 0, e = configVals.size(); i != e; ++i) { StringRef key, val; - llvm::tie(key, val) = configVals[i].split(":"); + llvm::tie(key, val) = configVals[i].split("="); if (val.empty()) { Diags.Report(SourceLocation(), diag::err_analyzer_config_no_value) << configVals[i]; Success = false; break; } - if (val.find(':') != StringRef::npos) { + if (val.find('=') != StringRef::npos) { Diags.Report(SourceLocation(), diag::err_analyzer_config_multiple_values) << configVals[i];