On Mon, Sep 12, 2011 at 10:43:01PM -0000, Chad Rosier wrote:
> Author: mcrosier
> Date: Mon Sep 12 17:43:01 2011
> New Revision: 139551
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139551&view=rev
> Log:
> [driver] Ignore the '--' option, rather then fail. Do so to match gcc's 
> behavior.
> rdar://10110352 and PR10908

I don't think this is a good idea. It violates POLA. Proper behavior
would at the very least ignore it silently. I'd suggest to start by
reverting this and committing some like the attached patch. It still
doesn't handle input file names starting with - (e.g. -c.c) correctly,
but that's a question of passing down the input correctly to internal
tools.

Joerg
Index: lib/Driver/OptTable.cpp
===================================================================
--- lib/Driver/OptTable.cpp	(revision 139582)
+++ lib/Driver/OptTable.cpp	(working copy)
@@ -237,6 +237,14 @@
   MissingArgIndex = MissingArgCount = 0;
   unsigned Index = 0, End = ArgEnd - ArgBegin;
   while (Index < End) {
+    if (strcmp(Args->getArgString(Index), "--") == 0) {
+      ++Index;
+      while (Index < End) {
+        Args->append(new Arg(TheInputOption, Index, Args->getArgString(Index)));
+        ++Index;
+      }
+      break;
+    }
     // Ignore empty arguments (other things may still take them as arguments).
     if (Args->getArgString(Index)[0] == '\0') {
       ++Index;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to