Add support for 'unsigned' command line arguments
[oota-llvm.git] / include / Support / CommandLine.h
index ed2559bd2b9f1af962eddc1a4cf789896efc9585..97b223c738148b174f34fdfbda963d5414decc58 100644 (file)
@@ -515,6 +515,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>
 //