[cfe-commits] r105747 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Option.cpp test/Driver/option-aliases.c

Daniel Dunbar daniel at zuster.org
Wed Jun 9 12:27:08 PDT 2010


Author: ddunbar
Date: Wed Jun  9 14:27:07 2010
New Revision: 105747

URL: http://llvm.org/viewvc/llvm-project?rev=105747&view=rev
Log:
Revert "Driver: Change Option parsing to always create arguments referring to
unaliased", this isn't quite right yet.

Removed:
    cfe/trunk/test/Driver/option-aliases.c
Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Driver/Option.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=105747&r1=105746&r2=105747&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Wed Jun  9 14:27:07 2010
@@ -713,4 +713,4 @@
 def _warn_ : Joined<"--warn-">, Alias<W_Joined>, Flags<[Unsupported]>;
 def _write_dependencies : Flag<"--write-dependencies">, Alias<MD>;
 def _write_user_dependencies : Flag<"--write-user-dependencies">, Alias<MMD>;
-def _ : Joined<"--">, Flags<[Unsupported]>;
+def _ : Joined<"--">, Alias<f>, Flags<[Unsupported]>;

Modified: cfe/trunk/lib/Driver/Option.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Option.cpp?rev=105747&r1=105746&r2=105747&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Option.cpp (original)
+++ cfe/trunk/lib/Driver/Option.cpp Wed Jun  9 14:27:07 2010
@@ -123,7 +123,7 @@
   if (strlen(getName()) != strlen(Args.getArgString(Index)))
     return 0;
 
-  return new FlagArg(getUnaliasedOption(), Index++);
+  return new FlagArg(this, Index++);
 }
 
 JoinedOption::JoinedOption(OptSpecifier ID, const char *Name,
@@ -133,7 +133,7 @@
 
 Arg *JoinedOption::accept(const InputArgList &Args, unsigned &Index) const {
   // Always matches.
-  return new JoinedArg(getUnaliasedOption(), Index++, strlen(getName()));
+  return new JoinedArg(this, Index++, strlen(getName()));
 }
 
 CommaJoinedOption::CommaJoinedOption(OptSpecifier ID, const char *Name,
@@ -150,7 +150,7 @@
   // Get the suffix string.
   // FIXME: Avoid strlen, and move to helper method?
   const char *Suffix = Args.getArgString(Index) + strlen(getName());
-  return new CommaJoinedArg(getUnaliasedOption(), Index++, Suffix);
+  return new CommaJoinedArg(this, Index++, Suffix);
 }
 
 SeparateOption::SeparateOption(OptSpecifier ID, const char *Name,
@@ -168,7 +168,7 @@
   if (Index > Args.getNumInputArgStrings())
     return 0;
 
-  return new SeparateArg(getUnaliasedOption(), Index - 2, 1);
+  return new SeparateArg(this, Index - 2, 1);
 }
 
 MultiArgOption::MultiArgOption(OptSpecifier ID, const char *Name,
@@ -188,7 +188,7 @@
   if (Index > Args.getNumInputArgStrings())
     return 0;
 
-  return new SeparateArg(getUnaliasedOption(), Index - 1 - NumArgs, NumArgs);
+  return new SeparateArg(this, Index - 1 - NumArgs, NumArgs);
 }
 
 JoinedOrSeparateOption::JoinedOrSeparateOption(OptSpecifier ID,
@@ -203,14 +203,14 @@
   // If this is not an exact match, it is a joined arg.
   // FIXME: Avoid strlen.
   if (strlen(getName()) != strlen(Args.getArgString(Index)))
-    return new JoinedArg(getUnaliasedOption(), Index++, strlen(getName()));
+    return new JoinedArg(this, Index++, strlen(getName()));
 
   // Otherwise it must be separate.
   Index += 2;
   if (Index > Args.getNumInputArgStrings())
     return 0;
 
-  return new SeparateArg(getUnaliasedOption(), Index - 2, 1);
+  return new SeparateArg(this, Index - 2, 1);
 }
 
 JoinedAndSeparateOption::JoinedAndSeparateOption(OptSpecifier ID,
@@ -228,6 +228,6 @@
   if (Index > Args.getNumInputArgStrings())
     return 0;
 
-  return new JoinedAndSeparateArg(getUnaliasedOption(), Index - 2,
-                                  strlen(getName()));
+  return new JoinedAndSeparateArg(this, Index - 2, strlen(getName()));
 }
+

Removed: cfe/trunk/test/Driver/option-aliases.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/option-aliases.c?rev=105746&view=auto
==============================================================================
--- cfe/trunk/test/Driver/option-aliases.c (original)
+++ cfe/trunk/test/Driver/option-aliases.c (removed)
@@ -1,11 +0,0 @@
-// RUN: %clang -ccc-print-options \
-// RUN:  --save-temps --undefine-macro=FOO --undefine-macro FOO \
-// RUN: --param=FOO --output=FOO 2> %t
-// RUN: FileCheck --check-prefix=CHECK-OPTIONS < %t %s
-
-// CHECK-OPTIONS: Option 0 - Name: "-ccc-print-options", Values: {}
-// CHECK-OPTIONS: Option 1 - Name: "-save-temps", Values: {}
-// CHECK-OPTIONS: Option 2 - Name: "-U", Values: {"FOO"}
-// CHECK-OPTIONS: Option 3 - Name: "-U", Values: {"FOO"}
-// CHECK-OPTIONS: Option 4 - Name: "--param", Values: {"FOO"}
-// CHECK-OPTIONS: Option 5 - Name: "-o", Values: {"FOO"}





More information about the cfe-commits mailing list