[llvm] r207501 - [C++11] Add 'override' keywords and remove 'virtual'. Additionally add 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. XCore edition

Craig Topper craig.topper at gmail.com
Tue Apr 29 08:38:14 PDT 2014


I just put the final on there to prove that the virtual was useless and
make them easy to find. I'm going to go back through and de-virtualize or
remove them soon.

On Tuesday, April 29, 2014, David Blaikie <dblaikie at gmail.com> wrote:

> On Tue, Apr 29, 2014 at 12:57 AM, Craig Topper <craig.topper at gmail.com<javascript:;>>
> wrote:
> > Author: ctopper
> > Date: Tue Apr 29 02:57:00 2014
> > New Revision: 207501
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=207501&view=rev
> > Log:
> > [C++11] Add 'override' keywords and remove 'virtual'. Additionally add
> 'final' and leave 'virtual' on some methods that are marked virtual without
> overriding anything and have no obvious overrides themselves.
>
> Is there any point to such a thing, or should it be non-virtual,
> non-final? (or non-virtual but final as a defense against an
> accidental override - though we have warnings for that)
>
> > XCore edition
> >
> > Modified:
> >     llvm/trunk/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
> >     llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.h
> >     llvm/trunk/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h
> >     llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
> >     llvm/trunk/lib/Target/XCore/XCoreFrameLowering.h
> >     llvm/trunk/lib/Target/XCore/XCoreFrameToArgsOffsetElim.cpp
> >     llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp
> >     llvm/trunk/lib/Target/XCore/XCoreISelLowering.h
> >     llvm/trunk/lib/Target/XCore/XCoreInstrInfo.h
> >     llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp
> >     llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h
> >     llvm/trunk/lib/Target/XCore/XCoreSelectionDAGInfo.h
> >     llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp
> >     llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h
> >     llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.h
> >
> > Modified: llvm/trunk/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp?rev=207501&r1=207500&r2=207501&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
> (original)
> > +++ llvm/trunk/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp Tue
> Apr 29 02:57:00 2014
> > @@ -42,7 +42,7 @@ public:
> >                                        const MemoryObject &region,
> >                                        uint64_t address,
> >                                        raw_ostream &vStream,
> > -                                      raw_ostream &cStream) const;
> > +                                      raw_ostream &cStream) const
> override;
> >
> >  };
> >  }
> >
> > Modified: llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.h?rev=207501&r1=207500&r2=207501&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.h (original)
> > +++ llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.h Tue Apr
> 29 02:57:00 2014
> > @@ -31,8 +31,8 @@ public:
> >    void printInstruction(const MCInst *MI, raw_ostream &O);
> >    static const char *getRegisterName(unsigned RegNo);
> >
> > -  virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
> > -  virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef
> Annot);
> > +  void printRegName(raw_ostream &OS, unsigned RegNo) const override;
> > +  void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot)
> override;
> >  private:
> >    void printInlineJT(const MCInst *MI, int opNum, raw_ostream &O);
> >    void printInlineJT32(const MCInst *MI, int opNum, raw_ostream &O);
> >
> > Modified: llvm/trunk/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h?rev=207501&r1<http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h?rev=207501&r1=207500&r2=207501&view=diff>



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


More information about the llvm-commits mailing list