[llvm-commits] [llvm] r163996 - /llvm/trunk/include/llvm/TableGen/Record.h

Craig Topper craig.topper at gmail.com
Sun Sep 16 13:45:19 PDT 2012


I have a patch to add LLVM_OVERRIDE and LLVM_FINAL that I'll commit
shortly. Do we want virtual and override or just override? People are used
to seeing virtual and know what it means. Just override at the end of the
line is a little less obvious. We obviously have inconsistent usage of
virtuals all over the tree today so would probably good to have a standard.

On Sunday, September 16, 2012, Craig Topper wrote:

>
>
> On Sunday, September 16, 2012, Sean Silva wrote:
>
> Maybe we should add LLVM_OVERRIDE to our C++11-prep arsenal? This
> really isn't what the `virtual` keyword is meant for...
>
> --Sean Silva
>
> On Sun, Sep 16, 2012 at 3:39 AM, Craig Topper <craig.topper at gmail.com>
> wrote:
> > Author: ctopper
> > Date: Sun Sep 16 02:39:55 2012
> > New Revision: 163996
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=163996&view=rev
> > Log:
> > Add explicit virtual keywords for methods that override base class.
> >
> > Modified:
> >     llvm/trunk/include/llvm/TableGen/Record.h
> >
> > Modified: llvm/trunk/include/llvm/TableGen/Record.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=163996&r1=163995&r2=163996&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/TableGen/Record.h (original)
> > +++ llvm/trunk/include/llvm/TableGen/Record.h Sun Sep 16 02:39:55 2012
> > @@ -152,9 +152,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const { return "bit"; }
> > +  virtual std::string getAsString() const { return "bit"; }
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >    virtual bool baseClassOf(const BitRecTy    *RHS) const { return true;
> }
> > @@ -195,9 +195,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const;
> > +  virtual std::string getAsString() const;
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >    virtual bool baseClassOf(const BitRecTy    *RHS) const { return Size
> == 1; }
> > @@ -237,9 +237,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const { return "int"; }
> > +  virtual std::string getAsString() const { return "int"; }
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >
> > @@ -278,9 +278,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const { return "string"; }
> > +  virtual std::string getAsString() const { return "string"; }
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >
> > @@ -322,9 +322,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const;
> > +  virtual std::string getAsString() const;
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >
> > @@ -363,9 +363,9 @@
> >    virtual Init *convertValue(   VarInit *VI) { return
> RecTy::convertValue(VI);}
> >    virtual Init *convertValue( FieldInit *FI) { return
> RecTy::convertValue(FI);}
> >
> > -  std::string getAsString() const { return "dag"; }
> > +  virtual std::string getAsString() const { return "dag"; }
> >
> > -  bool typeIsConvertibleTo(const RecTy *RHS) const {
> > +  virtual bool typeIsConvertibleTo(const RecTy *RHS) const {
> >      return RHS->baseClassOf(this);
> >    }
> >
> > @@ -407,9 +407,9 @@
> >
>
> --
> ~Craig
>


-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120916/601adf09/attachment.html>


More information about the llvm-commits mailing list