[llvm-commits] [dragonegg] r154019 - in /dragonegg/trunk: README src/Backend.cpp

Duncan Sands baldrick at free.fr
Wed Apr 4 07:57:53 PDT 2012


Author: baldrick
Date: Wed Apr  4 09:57:53 2012
New Revision: 154019

URL: http://llvm.org/viewvc/llvm-project?rev=154019&view=rev
Log:
Make it possible to pass LLVM options containing an equals signs (GCC doesn't
allow such plugin options) by morphing colons into equals signs.

Modified:
    dragonegg/trunk/README
    dragonegg/trunk/src/Backend.cpp

Modified: dragonegg/trunk/README
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/README?rev=154019&r1=154018&r2=154019&view=diff
==============================================================================
--- dragonegg/trunk/README (original)
+++ dragonegg/trunk/README Wed Apr  4 09:57:53 2012
@@ -122,4 +122,5 @@
   a file instead.  Good for seeing which GCC output we've failed to turn off.
 
 -fplugin-arg-dragonegg-llvm-option=option
-  Pass a command line option through to LLVM.
+  Pass a command line option through to LLVM.  If you want to pass an option
+  that contains equals signs then you need to use colons (':') instead of '='.

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=154019&r1=154018&r2=154019&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Wed Apr  4 09:57:53 2012
@@ -2101,7 +2101,14 @@
                 plugin_name, argv[i].key);
           continue;
         }
-        ArgStrings.push_back(argv[i].value);
+        std::string value(argv[i].value);
+        // Turn ':' into '=' everywhere.  This is because '=' is useful for
+        // passing settings to LLVM but GCC doesn't allow it.
+        for (std::string::iterator I = value.begin(), E = value.end(); I != E;
+             ++I)
+          if (*I == ':')
+            *I = '=';
+        ArgStrings.push_back(value);
         continue;
       }
 





More information about the llvm-commits mailing list