Make 'Insert' set the name for Loads, instead of passing the name into the
[oota-llvm.git] / include / llvm / Support / CommandLine.h
index 27782c875fffbe1886d5e53554ed7149d7468972..2e1661286c75aa9fc958bbc059724ce116e39546 100644 (file)
@@ -219,14 +219,14 @@ public:
   Option *getNextRegisteredOption() const { return NextRegistered; }
 
   // Return the width of the option tag for printing...
-  virtual unsigned getOptionWidth() const = 0;
+  virtual size_t getOptionWidth() const = 0;
 
   // printOptionInfo - Print out information about this option.  The
   // to-be-maintained width is specified.
   //
-  virtual void printOptionInfo(unsigned GlobalWidth) const = 0;
+  virtual void printOptionInfo(size_t GlobalWidth) const = 0;
 
-  virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {}
+  virtual void getExtraOptionNames(std::vector<const char*> &) {}
 
   // addOccurrence - Wrapper around handleOccurrence that enforces Flags
   //
@@ -324,17 +324,18 @@ public:
     Values.push_back(std::make_pair(EnumName, std::make_pair(Val, Desc)));
 
     // Process the varargs portion of the values...
-    while (const char *EnumName = va_arg(ValueArgs, const char *)) {
+    while (const char *enumName = va_arg(ValueArgs, const char *)) {
       DataType EnumVal = static_cast<DataType>(va_arg(ValueArgs, int));
       const char *EnumDesc = va_arg(ValueArgs, const char *);
-      Values.push_back(std::make_pair(EnumName,      // Add value to value map
+      Values.push_back(std::make_pair(enumName,      // Add value to value map
                                       std::make_pair(EnumVal, EnumDesc)));
     }
   }
 
   template<class Opt>
   void apply(Opt &O) const {
-    for (unsigned i = 0, e = Values.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(Values.size());
+         i != e; ++i)
       O.getParser().addLiteralOption(Values[i].first, Values[i].second.first,
                                      Values[i].second.second);
   }
@@ -378,12 +379,12 @@ struct generic_parser_base {
   virtual const char *getDescription(unsigned N) const = 0;
 
   // Return the width of the option tag for printing...
-  virtual unsigned getOptionWidth(const Option &O) const;
+  virtual size_t getOptionWidth(const Option &O) const;
 
   // printOptionInfo - Print out information about this option.  The
   // to-be-maintained width is specified.
   //
-  virtual void printOptionInfo(const Option &O, unsigned GlobalWidth) const;
+  virtual void printOptionInfo(const Option &O, size_t GlobalWidth) const;
 
   void initialize(Option &O) {
     // All of the modifiers for the option have been processed by now, so the
@@ -459,7 +460,8 @@ public:
     else
       ArgVal = ArgName;
 
-    for (unsigned i = 0, e = Values.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(Values.size());
+         i != e; ++i)
       if (ArgVal == Values[i].first) {
         V = Values[i].second.first;
         return false;
@@ -497,17 +499,17 @@ struct basic_parser_impl {  // non-template implementation of basic_parser<t>
     return ValueRequired;
   }
 
-  void getExtraOptionNames(std::vector<const char*> &OptionNames) {}
+  void getExtraOptionNames(std::vector<const char*> &) {}
 
-  void initialize(Option &O) {}
+  void initialize(Option &) {}
 
   // Return the width of the option tag for printing...
-  unsigned getOptionWidth(const Option &O) const;
+  size_t getOptionWidth(const Option &O) const;
 
   // printOptionInfo - Print out information about this option.  The
   // to-be-maintained width is specified.
   //
-  void printOptionInfo(const Option &O, unsigned GlobalWidth) const;
+  void printOptionInfo(const Option &O, size_t GlobalWidth) const;
 
   // getValueName - Overload in subclass to provide a better default value.
   virtual const char *getValueName() const { return "value"; }
@@ -649,7 +651,7 @@ template<>
 class parser<std::string> : public basic_parser<std::string> {
 public:
   // parse - Return true on error.
-  bool parse(Option &O, const char *AN, const std::string &Arg,
+  bool parse(Option &, const char *, const std::string &Arg,
              std::string &Value) {
     Value = Arg;
     return false;
@@ -815,8 +817,8 @@ class opt : public Option,
   }
 
   // Forward printing stuff to the parser...
-  virtual unsigned getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(unsigned GlobalWidth) const {
+  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
+  virtual void printOptionInfo(size_t GlobalWidth) const {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
@@ -981,8 +983,8 @@ class list : public Option, public list_storage<DataType, Storage> {
   }
 
   // Forward printing stuff to the parser...
-  virtual unsigned getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(unsigned GlobalWidth) const {
+  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
+  virtual void printOptionInfo(size_t GlobalWidth) const {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
@@ -1167,8 +1169,8 @@ class bits : public Option, public bits_storage<DataType, Storage> {
   }
 
   // Forward printing stuff to the parser...
-  virtual unsigned getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(unsigned GlobalWidth) const {
+  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
+  virtual void printOptionInfo(size_t GlobalWidth) const {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
@@ -1255,13 +1257,13 @@ public:
 
 class alias : public Option {
   Option *AliasFor;
-  virtual bool handleOccurrence(unsigned pos, const char *ArgName,
+  virtual bool handleOccurrence(unsigned pos, const char * /*ArgName*/,
                                 const std::string &Arg) {
     return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
   }
   // Handle printing stuff...
-  virtual unsigned getOptionWidth() const;
-  virtual void printOptionInfo(unsigned GlobalWidth) const;
+  virtual size_t getOptionWidth() const;
+  virtual void printOptionInfo(size_t GlobalWidth) const;
 
   void done() {
     if (!hasArgStr())