[llvm-commits] [dragonegg] r131904 - /dragonegg/trunk/src/Backend.cpp

Duncan Sands baldrick at free.fr
Mon May 23 10:09:46 PDT 2011


Author: baldrick
Date: Mon May 23 12:09:46 2011
New Revision: 131904

URL: http://llvm.org/viewvc/llvm-project?rev=131904&view=rev
Log:
Fail in a less in-your-face way when a command line options is given
with a wrong parameter (the compiler will still bail out, but without
saying that the plugin failed).  If a command line option is not
recognized then output a warning rather than an error like gcc does.

Modified:
    dragonegg/trunk/src/Backend.cpp

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=131904&r1=131903&r2=131904&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon May 23 12:09:46 2011
@@ -2423,12 +2423,12 @@
         if (!argv[i].value) {
           error(G_("no value supplied for option '-fplugin-arg-%s-%s'"),
                 plugin_name, argv[i].key);
-          return 1;
+          continue;
         }
         if (argv[i].value[0] < '0' || argv[i].value[0] > '9' || argv[i].value[1]) {
           error(G_("invalid option argument '-fplugin-arg-%s-%s=%s'"),
                 plugin_name, argv[i].key, argv[i].value);
-          return 1;
+          continue;
         }
         int OptLevel = argv[i].value[0] - '0';
         if (argv[i].key[5] == 'i')
@@ -2442,7 +2442,7 @@
       if (argv[i].value) {
         error(G_("invalid option argument '-fplugin-arg-%s-%s=%s'"),
               plugin_name, argv[i].key, argv[i].value);
-        return 1;
+        continue;
       }
 
       // Look for a matching flag.
@@ -2454,11 +2454,9 @@
           break;
         }
 
-      if (!Found) {
-        error(G_("invalid option '-fplugin-arg-%s-%s'"),
+      if (!Found)
+        warning(0, G_("unrecognised option '-fplugin-arg-%s-%s'"),
               plugin_name, argv[i].key);
-        return 1;
-      }
     }
   }
 





More information about the llvm-commits mailing list