[PATCH] Option parsing: allow alias arguments

Hans Wennborg hans at chromium.org
Wed Jul 31 11:14:58 PDT 2013



================
Comment at: unittests/Option/OptionParsingTest.cpp:35
@@ -32,1 +34,3 @@
 
+#define ALIASARGS(NAME, VALUE) const char *const NAME[] = VALUE;
+#include "Opts.inc"
----------------
Reid Kleckner wrote:
> I'm not thrilled about having another table on the side that needs to be implemented in both clang and lld.  What do you think about making a string like: "arg1\0arg2\0arg3\0"?
> 
> The termination condition is a double null character, where the second is inserted implicitly by the compiler.  This string can easily be split into multiple C strings.  Do we need empty string alias arguments?  If not, this would work.
This sounds good to me.

================
Comment at: utils/TableGen/OptParserEmitter.cpp:160
@@ +159,3 @@
+    const Record &R = *Opts[i];
+    const ListInit *AliasArgs = R.getValueAsListInit("AliasArgs");
+    if (AliasArgs->size() == 0)
----------------
Reid Kleckner wrote:
> Can this use R.getValueAsListOfStrings()?
> 
Yup. I'll use that in the new patch.


http://llvm-reviews.chandlerc.com/D1245



More information about the llvm-commits mailing list