[PATCH] Option parsing: allow alias arguments

Hans Wennborg hans at chromium.org
Tue Jul 30 18:41:13 PDT 2013


Hi rnk, Bigcheese,

This patch makes option aliases more powerful by enabling them to pass along arguments to the option they're aliasing.

For example, if we have a joined option "-foo=", we can now specify a flag "-bar" to be an alias of that, with the argument "baz".

This is especially useful for the cl.exe compatible clang driver, where many options are aliases. For example, this patch would enable us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to "-Werror" (again, -W is a joined option).

Please take a look.

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

Files:
  include/llvm/Option/OptParser.td
  include/llvm/Option/OptTable.h
  include/llvm/Option/Option.h
  lib/Option/Option.cpp
  unittests/Option/OptionParsingTest.cpp
  unittests/Option/Opts.td
  utils/TableGen/OptParserEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1245.1.patch
Type: text/x-patch
Size: 8099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130730/a7844507/attachment.bin>


More information about the llvm-commits mailing list