From: Hans Wennborg Date: Wed, 31 Jul 2013 22:44:41 +0000 (+0000) Subject: Option parsing: add support for alias arguments. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=9dd8c0cffe7de82900823c05159bba765120f1e3 Option parsing: add support for alias arguments. This 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 option "-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 enables us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to "-Werror" (again, -W is a joined option). Differential Revision: http://llvm-reviews.chandlerc.com/D1245 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187537 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Option/OptParser.td b/include/llvm/Option/OptParser.td index 394e0b6a4b0..32cc2c0cd5b 100644 --- a/include/llvm/Option/OptParser.td +++ b/include/llvm/Option/OptParser.td @@ -89,6 +89,7 @@ class Option prefixes, string name, OptionKind kind> { list Flags = []; OptionGroup Group = ?; Option Alias = ?; + list AliasArgs = []; } // Helpers for defining options. @@ -113,6 +114,7 @@ class JoinedAndSeparate prefixes, string name> // Mix-ins for adding optional attributes. class Alias