Option parsing: support case-insensitive option matching.

Link.exe's command line options are case-insensitive. This patch
adds a new attribute to OptTable to let the option parser to compare
options, ignoring case.

Command lines are generally case-insensitive on Windows. CL.exe is an
exception. So this new attribute should be useful for other commands
running on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1485

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama
2013-08-27 23:47:01 +00:00
parent 587e1939fa
commit 055f4e99ff
4 changed files with 89 additions and 55 deletions

View File

@ -51,6 +51,7 @@ private:
/// \brief The static option information table.
const Info *OptionInfos;
unsigned NumOptionInfos;
bool IgnoreCase;
unsigned TheInputOptionID;
unsigned TheUnknownOptionID;
@ -72,7 +73,8 @@ private:
}
protected:
OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos);
OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos,
bool _IgnoreCase = false);
public:
~OptTable();