From 53f3e7dba329e6f6bce06db702cb2b728b5ab8d3 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 30 Aug 2012 05:49:16 +0000 Subject: [PATCH] Change -analyzer-config to use '=' as the key-value separator, and only support the '-analyzer-config key=val' variant. llvm-svn: 162891 --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 2 +- clang/include/clang/Driver/CC1Options.td | 4 +--- clang/lib/Frontend/CompilerInvocation.cpp | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 724a9a813b0b..e0a89a1cc381 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/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/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index 9213d217ef7c..53bbfa4ed25c 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/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/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8935e775a73b..6f6ef42c6ff9 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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]; -- GitLab