summaryrefslogtreecommitdiff
path: root/include/clang/Driver/Options.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2012-10-22 22:13:48 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2012-10-22 22:13:48 +0000
commitc635710bcbb9598acd5a14647ba7ca28bee89a68 (patch)
tree978feeef3e87ac75ea630c0c301bc5c96a79b1af /include/clang/Driver/Options.h
parent6b8194e4d7ca980087a3a5e1addb74090be990ff (diff)
downloadclang-c635710bcbb9598acd5a14647ba7ca28bee89a68.tar.gz
[Options] Add prefixes to options.
Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Driver/Options.h')
-rw-r--r--include/clang/Driver/Options.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/clang/Driver/Options.h b/include/clang/Driver/Options.h
index ac312cdfd4..6c114e252d 100644
--- a/include/clang/Driver/Options.h
+++ b/include/clang/Driver/Options.h
@@ -17,11 +17,13 @@ namespace driver {
namespace options {
enum ID {
OPT_INVALID = 0, // This is not an option ID.
-#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
+#define PREFIX(NAME, VALUE)
+#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
HELPTEXT, METAVAR) OPT_##ID,
#include "clang/Driver/Options.inc"
LastOption
#undef OPTION
+#undef PREFIX
};
}