]> granicus.if.org Git - clang/commit
[Options] Add prefixes to options.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 22 Oct 2012 22:13:48 +0000 (22:13 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 22 Oct 2012 22:13:48 +0000 (22:13 +0000)
commitc635710bcbb9598acd5a14647ba7ca28bee89a68
tree978feeef3e87ac75ea630c0c301bc5c96a79b1af
parent6b8194e4d7ca980087a3a5e1addb74090be990ff
[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
19 files changed:
include/clang/Driver/Arg.h
include/clang/Driver/CC1AsOptions.h
include/clang/Driver/CC1AsOptions.td
include/clang/Driver/CC1Options.td
include/clang/Driver/OptParser.td
include/clang/Driver/OptTable.h
include/clang/Driver/Option.h
include/clang/Driver/Options.h
include/clang/Driver/Options.td
lib/Driver/Arg.cpp
lib/Driver/ArgList.cpp
lib/Driver/CC1AsOptions.cpp
lib/Driver/Driver.cpp
lib/Driver/DriverOptions.cpp
lib/Driver/OptTable.cpp
lib/Driver/Option.cpp
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
utils/TableGen/OptParserEmitter.cpp