[cfe-commits] r162891 - in /cfe/trunk: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/CC1Options.td lib/Frontend/CompilerInvocation.cpp

Ted Kremenek kremenek at apple.com
Wed Aug 29 22:49:16 PDT 2012


Author: kremenek
Date: Thu Aug 30 00:49:16 2012
New Revision: 162891

URL: http://llvm.org/viewvc/llvm-project?rev=162891&view=rev
Log:
Change -analyzer-config to use '=' as the key-value separator, and only
support the '-analyzer-config key=val' variant.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=162891&r1=162890&r2=162891&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Thu Aug 30 00:49:16 2012
@@ -145,5 +145,5 @@
 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 '='">;
 }

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=162891&r1=162890&r2=162891&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Thu Aug 30 00:49:16 2012
@@ -120,9 +120,7 @@
   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<analyzer_config>;
+  HelpText<"Choose analyzer options to enable">;
 
 //===----------------------------------------------------------------------===//
 // Migrator Options

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=162891&r1=162890&r2=162891&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Aug 30 00:49:16 2012
@@ -1161,20 +1161,20 @@
     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<StringRef, 4> 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];





More information about the cfe-commits mailing list