diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-28 15:47:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-28 15:47:20 +0000 |
commit | d2a6fc397ee982936dee7dd5692b1481bcd9fe8f (patch) | |
tree | 18334c195e72532f5d044c5f3ce2c402ae85bba1 /include/Support/CommandLine.h | |
parent | 3a56364f00b96a238f5de76a2c54bb34be8fd66f (diff) |
Add support for 'unsigned' command line arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/Support/CommandLine.h')
-rw-r--r-- | include/Support/CommandLine.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/Support/CommandLine.h b/include/Support/CommandLine.h index ed2559bd2b..97b223c738 100644 --- a/include/Support/CommandLine.h +++ b/include/Support/CommandLine.h @@ -516,6 +516,21 @@ struct parser<int> : public basic_parser<int> { //-------------------------------------------------- +// parser<unsigned> +// +template<> +struct parser<unsigned> : public basic_parser<unsigned> { + + // parse - Return true on error. + bool parse(Option &O, const char *ArgName, const std::string &Arg, + unsigned &Val); + + // getValueName - Overload in subclass to provide a better default value. + virtual const char *getValueName() const { return "uint"; } +}; + + +//-------------------------------------------------- // parser<double> // template<> |