[llvm] r202791 - [C+11] Add 'override' keyword to methods in the support library.

Craig Topper craig.topper at gmail.com
Mon Mar 3 22:24:12 PST 2014


Author: ctopper
Date: Tue Mar  4 00:24:11 2014
New Revision: 202791

URL: http://llvm.org/viewvc/llvm-project?rev=202791&view=rev
Log:
[C+11] Add 'override' keyword to methods in the support library.

Modified:
    llvm/trunk/include/llvm/ADT/FoldingSet.h
    llvm/trunk/include/llvm/IR/InstrTypes.h
    llvm/trunk/include/llvm/Support/CommandLine.h
    llvm/trunk/include/llvm/Support/Format.h
    llvm/trunk/include/llvm/Support/FormattedStream.h
    llvm/trunk/include/llvm/Support/Process.h
    llvm/trunk/include/llvm/Support/YAMLParser.h
    llvm/trunk/include/llvm/Support/YAMLTraits.h
    llvm/trunk/lib/Support/CommandLine.cpp

Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Tue Mar  4 00:24:11 2014
@@ -396,20 +396,20 @@ template<class T> class FoldingSet : pub
 private:
   /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
   /// way to convert nodes into a unique specifier.
-  virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const {
+  void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const override {
     T *TN = static_cast<T *>(N);
     FoldingSetTrait<T>::Profile(*TN, ID);
   }
   /// NodeEquals - Instantiations may optionally provide a way to compare a
   /// node with a specified ID.
-  virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
-                          FoldingSetNodeID &TempID) const {
+  bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
+                  FoldingSetNodeID &TempID) const override {
     T *TN = static_cast<T *>(N);
     return FoldingSetTrait<T>::Equals(*TN, ID, IDHash, TempID);
   }
   /// ComputeNodeHash - Instantiations may optionally provide a way to compute a
   /// hash value directly from a node.
-  virtual unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const {
+  unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const override {
     T *TN = static_cast<T *>(N);
     return FoldingSetTrait<T>::ComputeHash(*TN, TempID);
   }
@@ -473,20 +473,19 @@ private:
 
   /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
   /// way to convert nodes into a unique specifier.
-  virtual void GetNodeProfile(FoldingSetImpl::Node *N,
-                              FoldingSetNodeID &ID) const {
+  void GetNodeProfile(FoldingSetImpl::Node *N,
+                      FoldingSetNodeID &ID) const override {
     T *TN = static_cast<T *>(N);
     ContextualFoldingSetTrait<T, Ctx>::Profile(*TN, ID, Context);
   }
-  virtual bool NodeEquals(FoldingSetImpl::Node *N,
-                          const FoldingSetNodeID &ID, unsigned IDHash,
-                          FoldingSetNodeID &TempID) const {
+  bool NodeEquals(FoldingSetImpl::Node *N, const FoldingSetNodeID &ID,
+                  unsigned IDHash, FoldingSetNodeID &TempID) const override {
     T *TN = static_cast<T *>(N);
     return ContextualFoldingSetTrait<T, Ctx>::Equals(*TN, ID, IDHash, TempID,
                                                      Context);
   }
-  virtual unsigned ComputeNodeHash(FoldingSetImpl::Node *N,
-                                   FoldingSetNodeID &TempID) const {
+  unsigned ComputeNodeHash(FoldingSetImpl::Node *N,
+                           FoldingSetNodeID &TempID) const override {
     T *TN = static_cast<T *>(N);
     return ContextualFoldingSetTrait<T, Ctx>::ComputeHash(*TN, TempID, Context);
   }

Modified: llvm/trunk/include/llvm/IR/InstrTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/InstrTypes.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/InstrTypes.h (original)
+++ llvm/trunk/include/llvm/IR/InstrTypes.h Tue Mar  4 00:24:11 2014
@@ -51,7 +51,7 @@ protected:
   virtual BasicBlock *getSuccessorV(unsigned idx) const = 0;
   virtual unsigned getNumSuccessorsV() const = 0;
   virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
-  virtual TerminatorInst *clone_impl() const = 0;
+  TerminatorInst *clone_impl() const override = 0;
 public:
 
   /// getNumSuccessors - Return the number of successors that this terminator

Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Tue Mar  4 00:24:11 2014
@@ -380,7 +380,9 @@ struct OptionValueBase : public GenericO
 
   bool compare(const DataType &/*V*/) const { return false; }
 
-  virtual bool compare(const GenericOptionValue& /*V*/) const { return false; }
+  bool compare(const GenericOptionValue& /*V*/) const override {
+    return false;
+  }
 };
 
 // Simple copy of the option value.
@@ -404,7 +406,7 @@ public:
     return Valid && (Value != V);
   }
 
-  virtual bool compare(const GenericOptionValue &V) const {
+  bool compare(const GenericOptionValue &V) const override {
     const OptionValueCopy<DataType> &VC =
       static_cast< const OptionValueCopy<DataType>& >(V);
     if (!VC.hasValue()) return false;
@@ -450,7 +452,7 @@ struct OptionValue<cl::boolOrDefault> :
     return *this;
   }
 private:
-  virtual void anchor();
+  void anchor() override;
 };
 
 template<>
@@ -467,7 +469,7 @@ struct OptionValue<std::string> : Option
     return *this;
   }
 private:
-  virtual void anchor();
+  void anchor() override;
 };
 
 //===----------------------------------------------------------------------===//
@@ -646,14 +648,14 @@ public:
   typedef DataType parser_data_type;
 
   // Implement virtual functions needed by generic_parser_base
-  unsigned getNumOptions() const { return unsigned(Values.size()); }
-  const char *getOption(unsigned N) const { return Values[N].Name; }
-  const char *getDescription(unsigned N) const {
+  unsigned getNumOptions() const override { return unsigned(Values.size()); }
+  const char *getOption(unsigned N) const override { return Values[N].Name; }
+  const char *getDescription(unsigned N) const override {
     return Values[N].HelpStr;
   }
 
   // getOptionValue - Return the value of option name N.
-  virtual const GenericOptionValue &getOptionValue(unsigned N) const {
+  const GenericOptionValue &getOptionValue(unsigned N) const override {
     return Values[N].V;
   }
 
@@ -762,13 +764,13 @@ public:
   }
 
   // getValueName - Do not print =<value> at all.
-  virtual const char *getValueName() const { return 0; }
+  const char *getValueName() const override { return 0; }
 
   void printOptionDiff(const Option &O, bool V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<bool>);
@@ -786,13 +788,13 @@ public:
   }
 
   // getValueName - Do not print =<value> at all.
-  virtual const char *getValueName() const { return 0; }
+  const char *getValueName() const override { return 0; }
 
   void printOptionDiff(const Option &O, boolOrDefault V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<boolOrDefault>);
@@ -807,13 +809,13 @@ public:
   bool parse(Option &O, StringRef ArgName, StringRef Arg, int &Val);
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "int"; }
+  const char *getValueName() const override { return "int"; }
 
   void printOptionDiff(const Option &O, int V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<int>);
@@ -829,13 +831,13 @@ public:
   bool parse(Option &O, StringRef ArgName, StringRef Arg, unsigned &Val);
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "uint"; }
+  const char *getValueName() const override { return "uint"; }
 
   void printOptionDiff(const Option &O, unsigned V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<unsigned>);
@@ -851,13 +853,13 @@ public:
              unsigned long long &Val);
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "uint"; }
+  const char *getValueName() const override { return "uint"; }
 
   void printOptionDiff(const Option &O, unsigned long long V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<unsigned long long>);
@@ -872,13 +874,13 @@ public:
   bool parse(Option &O, StringRef ArgName, StringRef Arg, double &Val);
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "number"; }
+  const char *getValueName() const override { return "number"; }
 
   void printOptionDiff(const Option &O, double V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<double>);
@@ -893,13 +895,13 @@ public:
   bool parse(Option &O, StringRef ArgName, StringRef Arg, float &Val);
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "number"; }
+  const char *getValueName() const override { return "number"; }
 
   void printOptionDiff(const Option &O, float V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<float>);
@@ -917,13 +919,13 @@ public:
   }
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "string"; }
+  const char *getValueName() const override { return "string"; }
 
   void printOptionDiff(const Option &O, StringRef V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<std::string>);
@@ -941,13 +943,13 @@ public:
   }
 
   // getValueName - Overload in subclass to provide a better default value.
-  virtual const char *getValueName() const { return "char"; }
+  const char *getValueName() const override { return "char"; }
 
   void printOptionDiff(const Option &O, char V, OptVal Default,
                        size_t GlobalWidth) const;
 
   // An out-of-line virtual method to provide a 'home' for this class.
-  virtual void anchor();
+  void anchor() override;
 };
 
 EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<char>);
@@ -1157,8 +1159,8 @@ class opt : public Option,
                                is_class<DataType>::value> {
   ParserClass Parser;
 
-  virtual bool handleOccurrence(unsigned pos, StringRef ArgName,
-                                StringRef Arg) {
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
     typename ParserClass::parser_data_type Val =
        typename ParserClass::parser_data_type();
     if (Parser.parse(*this, ArgName, Arg, Val))
@@ -1168,20 +1170,20 @@ class opt : public Option,
     return false;
   }
 
-  virtual enum ValueExpected getValueExpectedFlagDefault() const {
+  enum ValueExpected getValueExpectedFlagDefault() const override {
     return Parser.getValueExpectedFlagDefault();
   }
-  virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
+  void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) override {
     return Parser.getExtraOptionNames(OptionNames);
   }
 
   // Forward printing stuff to the parser...
-  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(size_t GlobalWidth) const {
+  size_t getOptionWidth() const override {return Parser.getOptionWidth(*this);}
+  void printOptionInfo(size_t GlobalWidth) const override {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
-  virtual void printOptionValue(size_t GlobalWidth, bool Force) const {
+  void printOptionValue(size_t GlobalWidth, bool Force) const override {
     if (Force || this->getDefault().compare(this->getValue())) {
       cl::printOptionDiff<ParserClass>(
         *this, Parser, this->getValue(), this->getDefault(), GlobalWidth);
@@ -1328,14 +1330,15 @@ class list : public Option, public list_
   std::vector<unsigned> Positions;
   ParserClass Parser;
 
-  virtual enum ValueExpected getValueExpectedFlagDefault() const {
+  enum ValueExpected getValueExpectedFlagDefault() const override {
     return Parser.getValueExpectedFlagDefault();
   }
-  virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
+  void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) override {
     return Parser.getExtraOptionNames(OptionNames);
   }
 
-  virtual bool handleOccurrence(unsigned pos, StringRef ArgName, StringRef Arg){
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
     typename ParserClass::parser_data_type Val =
       typename ParserClass::parser_data_type();
     if (Parser.parse(*this, ArgName, Arg, Val))
@@ -1347,13 +1350,14 @@ class list : public Option, public list_
   }
 
   // Forward printing stuff to the parser...
-  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(size_t GlobalWidth) const {
+  size_t getOptionWidth() const override {return Parser.getOptionWidth(*this);}
+  void printOptionInfo(size_t GlobalWidth) const override {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
   // Unimplemented: list options don't currently store their default value.
-  virtual void printOptionValue(size_t /*GlobalWidth*/, bool /*Force*/) const {}
+  void printOptionValue(size_t /*GlobalWidth*/,
+                        bool /*Force*/) const override {}
 
   void done() {
     addArgument();
@@ -1530,14 +1534,15 @@ class bits : public Option, public bits_
   std::vector<unsigned> Positions;
   ParserClass Parser;
 
-  virtual enum ValueExpected getValueExpectedFlagDefault() const {
+  enum ValueExpected getValueExpectedFlagDefault() const override {
     return Parser.getValueExpectedFlagDefault();
   }
-  virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
+  void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) override {
     return Parser.getExtraOptionNames(OptionNames);
   }
 
-  virtual bool handleOccurrence(unsigned pos, StringRef ArgName, StringRef Arg){
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
     typename ParserClass::parser_data_type Val =
       typename ParserClass::parser_data_type();
     if (Parser.parse(*this, ArgName, Arg, Val))
@@ -1549,13 +1554,14 @@ class bits : public Option, public bits_
   }
 
   // Forward printing stuff to the parser...
-  virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
-  virtual void printOptionInfo(size_t GlobalWidth) const {
+  size_t getOptionWidth() const override {return Parser.getOptionWidth(*this);}
+  void printOptionInfo(size_t GlobalWidth) const override {
     Parser.printOptionInfo(*this, GlobalWidth);
   }
 
   // Unimplemented: bits options don't currently store their default values.
-  virtual void printOptionValue(size_t /*GlobalWidth*/, bool /*Force*/) const {}
+  void printOptionValue(size_t /*GlobalWidth*/,
+                        bool /*Force*/) const override {}
 
   void done() {
     addArgument();
@@ -1640,19 +1646,19 @@ public:
 
 class alias : public Option {
   Option *AliasFor;
-  virtual bool handleOccurrence(unsigned pos, StringRef /*ArgName*/,
+  bool handleOccurrence(unsigned pos, StringRef /*ArgName*/,
                                 StringRef Arg) override {
     return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
   }
   // Handle printing stuff...
-  virtual size_t getOptionWidth() const override;
-  virtual void printOptionInfo(size_t GlobalWidth) const override;
+  size_t getOptionWidth() const override;
+  void printOptionInfo(size_t GlobalWidth) const override;
 
   // Aliases do not need to print their values.
-  virtual void printOptionValue(size_t /*GlobalWidth*/,
-                                bool /*Force*/) const override {}
+  void printOptionValue(size_t /*GlobalWidth*/,
+                        bool /*Force*/) const override {}
 
-  virtual ValueExpected getValueExpectedFlagDefault() const override {
+  ValueExpected getValueExpectedFlagDefault() const override {
     return AliasFor->getValueExpectedFlag();
   }
 

Modified: llvm/trunk/include/llvm/Support/Format.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Format.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Format.h (original)
+++ llvm/trunk/include/llvm/Support/Format.h Tue Mar  4 00:24:11 2014
@@ -84,7 +84,7 @@ public:
     : format_object_base(fmt), Val(val) {
   }
 
-  virtual int snprint(char *Buffer, unsigned BufferSize) const {
+  int snprint(char *Buffer, unsigned BufferSize) const override {
     return snprintf(Buffer, BufferSize, Fmt, Val);
   }
 };
@@ -102,7 +102,7 @@ public:
   : format_object_base(fmt), Val1(val1), Val2(val2) {
   }
 
-  virtual int snprint(char *Buffer, unsigned BufferSize) const {
+  int snprint(char *Buffer, unsigned BufferSize) const override {
     return snprintf(Buffer, BufferSize, Fmt, Val1, Val2);
   }
 };
@@ -121,7 +121,7 @@ public:
     : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3) {
   }
 
-  virtual int snprint(char *Buffer, unsigned BufferSize) const {
+  int snprint(char *Buffer, unsigned BufferSize) const override {
     return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3);
   }
 };
@@ -142,7 +142,7 @@ public:
     : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3), Val4(val4) {
   }
 
-  virtual int snprint(char *Buffer, unsigned BufferSize) const {
+  int snprint(char *Buffer, unsigned BufferSize) const override {
     return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3, Val4);
   }
 };
@@ -165,7 +165,7 @@ public:
       Val5(val5) {
   }
 
-  virtual int snprint(char *Buffer, unsigned BufferSize) const {
+  int snprint(char *Buffer, unsigned BufferSize) const override {
     return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3, Val4, Val5);
   }
 };

Modified: llvm/trunk/include/llvm/Support/FormattedStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormattedStream.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FormattedStream.h (original)
+++ llvm/trunk/include/llvm/Support/FormattedStream.h Tue Mar  4 00:24:11 2014
@@ -129,25 +129,23 @@ public:
 
   /// getLine - Return the line number
   unsigned getLine() { return Position.second; }
-  
-  raw_ostream &resetColor() {
+
+  raw_ostream &resetColor() override {
     TheStream->resetColor();
     return *this;
   }
-  
-  raw_ostream &reverseColor() {
+
+  raw_ostream &reverseColor() override {
     TheStream->reverseColor();
     return *this;
   }
-  
-  raw_ostream &changeColor(enum Colors Color,
-                           bool Bold,
-                           bool BG) {
+
+  raw_ostream &changeColor(enum Colors Color, bool Bold, bool BG) override {
     TheStream->changeColor(Color, Bold, BG);
     return *this;
   }
-  
-  bool is_displayed() const {
+
+  bool is_displayed() const override {
     return TheStream->is_displayed();
   }
 

Modified: llvm/trunk/include/llvm/Support/Process.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Process.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Process.h (original)
+++ llvm/trunk/include/llvm/Support/Process.h Tue Mar  4 00:24:11 2014
@@ -110,10 +110,10 @@ class self_process : public process {
   virtual ~self_process();
 
 public:
-  virtual id_type get_id();
-  virtual TimeValue get_user_time() const;
-  virtual TimeValue get_system_time() const;
-  virtual TimeValue get_wall_time() const;
+  id_type get_id() override;
+  TimeValue get_user_time() const override;
+  TimeValue get_system_time() const override;
+  TimeValue get_wall_time() const override;
 
   /// \name Process configuration (sysconf on POSIX)
   /// @{

Modified: llvm/trunk/include/llvm/Support/YAMLParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLParser.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/YAMLParser.h (original)
+++ llvm/trunk/include/llvm/Support/YAMLParser.h Tue Mar  4 00:24:11 2014
@@ -175,7 +175,7 @@ private:
 /// Example:
 ///   !!null null
 class NullNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   NullNode(OwningPtr<Document> &D)
       : Node(NK_Null, D, StringRef(), StringRef()) {}
@@ -191,7 +191,7 @@ public:
 /// Example:
 ///   Adena
 class ScalarNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   ScalarNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag,
              StringRef Val)
@@ -233,7 +233,7 @@ private:
 /// Example:
 ///   Section: .text
 class KeyValueNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   KeyValueNode(OwningPtr<Document> &D)
     : Node(NK_KeyValue, D, StringRef(), StringRef())
@@ -345,7 +345,7 @@ void skip(CollectionType &C) {
 ///   Name: _main
 ///   Scope: Global
 class MappingNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   enum MappingType {
     MT_Block,
@@ -395,7 +395,7 @@ private:
 ///   - Hello
 ///   - World
 class SequenceNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   enum SequenceType {
     ST_Block,
@@ -451,7 +451,7 @@ private:
 /// Example:
 ///   *AnchorName
 class AliasNode : public Node {
-  virtual void anchor();
+  void anchor() override;
 public:
   AliasNode(OwningPtr<Document> &D, StringRef Val)
     : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {}

Modified: llvm/trunk/include/llvm/Support/YAMLTraits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLTraits.h?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/YAMLTraits.h (original)
+++ llvm/trunk/include/llvm/Support/YAMLTraits.h Tue Mar  4 00:24:11 2014
@@ -750,29 +750,29 @@ public:
   llvm::error_code error();
 
 private:
-  virtual bool outputting();
-  virtual bool mapTag(StringRef, bool);
-  virtual void beginMapping();
-  virtual void endMapping();
-  virtual bool preflightKey(const char *, bool, bool, bool &, void *&);
-  virtual void postflightKey(void *);
-  virtual unsigned beginSequence();
-  virtual void endSequence();
-  virtual bool preflightElement(unsigned index, void *&);
-  virtual void postflightElement(void *);
-  virtual unsigned beginFlowSequence();
-  virtual bool preflightFlowElement(unsigned , void *&);
-  virtual void postflightFlowElement(void *);
-  virtual void endFlowSequence();
-  virtual void beginEnumScalar();
-  virtual bool matchEnumScalar(const char*, bool);
-  virtual void endEnumScalar();
-  virtual bool beginBitSetScalar(bool &);
-  virtual bool bitSetMatch(const char *, bool );
-  virtual void endBitSetScalar();
-  virtual void scalarString(StringRef &);
-  virtual void setError(const Twine &message);
-  virtual bool canElideEmptySequence();
+  bool outputting() override;
+  bool mapTag(StringRef, bool) override;
+  void beginMapping() override;
+  void endMapping() override;
+  bool preflightKey(const char *, bool, bool, bool &, void *&) override;
+  void postflightKey(void *) override;
+  unsigned beginSequence() override;
+  void endSequence() override;
+  bool preflightElement(unsigned index, void *&) override;
+  void postflightElement(void *) override;
+  unsigned beginFlowSequence() override;
+  bool preflightFlowElement(unsigned , void *&) override;
+  void postflightFlowElement(void *) override;
+  void endFlowSequence() override;
+  void beginEnumScalar() override;
+  bool matchEnumScalar(const char*, bool) override;
+  void endEnumScalar() override;
+  bool beginBitSetScalar(bool &) override;
+  bool bitSetMatch(const char *, bool ) override;
+  void endBitSetScalar() override;
+  void scalarString(StringRef &) override;
+  void setError(const Twine &message) override;
+  bool canElideEmptySequence() override;
 
   class HNode {
     virtual void anchor();
@@ -785,7 +785,7 @@ private:
   };
 
   class EmptyHNode : public HNode {
-    virtual void anchor();
+    void anchor() override;
   public:
     EmptyHNode(Node *n) : HNode(n) { }
     static inline bool classof(const HNode *n) {
@@ -795,7 +795,7 @@ private:
   };
 
   class ScalarHNode : public HNode {
-    virtual void anchor();
+    void anchor() override;
   public:
     ScalarHNode(Node *n, StringRef s) : HNode(n), _value(s) { }
 
@@ -875,29 +875,29 @@ public:
   Output(llvm::raw_ostream &, void *Ctxt=NULL);
   virtual ~Output();
 
-  virtual bool outputting();
-  virtual bool mapTag(StringRef, bool);
-  virtual void beginMapping();
-  virtual void endMapping();
-  virtual bool preflightKey(const char *key, bool, bool, bool &, void *&);
-  virtual void postflightKey(void *);
-  virtual unsigned beginSequence();
-  virtual void endSequence();
-  virtual bool preflightElement(unsigned, void *&);
-  virtual void postflightElement(void *);
-  virtual unsigned beginFlowSequence();
-  virtual bool preflightFlowElement(unsigned, void *&);
-  virtual void postflightFlowElement(void *);
-  virtual void endFlowSequence();
-  virtual void beginEnumScalar();
-  virtual bool matchEnumScalar(const char*, bool);
-  virtual void endEnumScalar();
-  virtual bool beginBitSetScalar(bool &);
-  virtual bool bitSetMatch(const char *, bool );
-  virtual void endBitSetScalar();
-  virtual void scalarString(StringRef &);
-  virtual void setError(const Twine &message);
-  virtual bool canElideEmptySequence();
+  bool outputting() override;
+  bool mapTag(StringRef, bool) override;
+  void beginMapping() override;
+  void endMapping() override;
+  bool preflightKey(const char *key, bool, bool, bool &, void *&) override;
+  void postflightKey(void *) override;
+  unsigned beginSequence() override;
+  void endSequence() override;
+  bool preflightElement(unsigned, void *&) override;
+  void postflightElement(void *) override;
+  unsigned beginFlowSequence() override;
+  bool preflightFlowElement(unsigned, void *&) override;
+  void postflightFlowElement(void *) override;
+  void endFlowSequence() override;
+  void beginEnumScalar() override;
+  bool matchEnumScalar(const char*, bool) override;
+  void endEnumScalar() override;
+  bool beginBitSetScalar(bool &) override;
+  bool bitSetMatch(const char *, bool ) override;
+  void endBitSetScalar() override;
+  void scalarString(StringRef &) override;
+  void setError(const Twine &message) override;
+  bool canElideEmptySequence() override;
 public:
   // These are only used by operator<<. They could be private
   // if that templated operator could be made a friend.

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=202791&r1=202790&r2=202791&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Tue Mar  4 00:24:11 2014
@@ -1507,7 +1507,7 @@ public:
   using HelpPrinter::operator= ;
 
 protected:
-  virtual void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) {
+  void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) override {
     std::vector<OptionCategory *> SortedCategories;
     std::map<OptionCategory *, std::vector<Option *> > CategorizedOptions;
 





More information about the llvm-commits mailing list