[LLVMbugs] [Bug 21101] New: Overridden virtual functions now require the override keyword

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 30 14:25:34 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21101

            Bug ID: 21101
           Summary: Overridden virtual functions now require the override
                    keyword
           Product: tools
           Version: trunk
          Hardware: All
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedbugs at nondot.org
          Reporter: fjahanian at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I will be checking in a patch which will warn when overriding methods do not
have
the 'override' keyword. 'override' is a c++11 addition. We need a top-level 
facility which flags that certain generated methods override virtual functions
and
therefore require 'override' keyword added to their declaration. Without this
feature, we will be getting the following warnings:

In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/ARM/ARMFastISel.cpp:142:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/ARM/ARMGenFastISel.inc:2301:10:
warning: 'fastEmit_r' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill) {
         ^                                                                     
    ~
                                                                               
    ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:329:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/ARM/ARMFastISel.cpp:142:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/ARM/ARMGenFastISel.inc:3918:10:
warning: 'fastEmit_rr' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, unsigned Op1, bool Op1IsKill) {
         ^                                                                     
                                   ~
                                                                               
                                   ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:334:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned
Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/ARM/ARMFastISel.cpp:142:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/ARM/ARMGenFastISel.inc:4268:10:
warning: 'fastEmit_rri' overrides a member function but is not marked
'override' [-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_rri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t imm2) {
         ^                                                                     
                                                   ~
                                                                               
                                                   ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:352:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_rri(MVT VT, MVT RetVT, unsigned Opcode,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/ARM/ARMFastISel.cpp:142:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/ARM/ARMGenFastISel.inc:5175:10:
warning: 'fastEmit_ri' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, uint64_t imm1) {
         ^                                                                     
                    ~
                                                                               
                    ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:340:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned
Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/ARM/ARMFastISel.cpp:142:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/ARM/ARMGenFastISel.inc:6260:10:
warning: 'fastEmit_i' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t imm0) {
         ^                                                           ~
                                                                     ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:366:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t
Imm);
                   ^

and:
llvm[2]: Compiling StackColoring.cpp for Debug+Asserts build
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/X86/X86FastISel.cpp:80:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/X86/X86GenFastISel.inc:2411:10:
warning: 'fastEmit_r' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill) {
         ^                                                                     
    ~
                                                                               
    ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:329:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/X86/X86FastISel.cpp:80:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/X86/X86GenFastISel.inc:7067:10:
warning: 'fastEmit_rr' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, unsigned Op1, bool Op1IsKill) {
         ^                                                                     
                                   ~
                                                                               
                                   ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:334:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned
Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/X86/X86FastISel.cpp:80:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/X86/X86GenFastISel.inc:8516:10:
warning: 'fastEmit_rri' overrides a member function but is not marked
'override' [-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_rri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, unsigned Op1, bool Op1IsKill, uint64_t imm2) {
         ^                                                                     
                                                   ~
                                                                               
                                                   ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:352:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_rri(MVT VT, MVT RetVT, unsigned Opcode,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/X86/X86FastISel.cpp:80:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/X86/X86GenFastISel.inc:9568:10:
warning: 'fastEmit_ri' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0, bool
Op0IsKill, uint64_t imm1) {
         ^                                                                     
                    ~
                                                                               
                    ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:340:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned
Op0,
                   ^
In file included from
/Users/jahanian/sandbox/llvm-tot/lib/Target/X86/X86FastISel.cpp:80:
/Users/jahanian/sandbox/llvm-override-build/lib/Target/X86/X86GenFastISel.inc:9803:10:
warning: 'fastEmit_i' overrides a member function but is not marked 'override'
[-Wwarn-missing-override-on-overriding-method]
unsigned fastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t imm0) {
         ^                                                           ~
                                                                     ) override
/Users/jahanian/sandbox/llvm-tot/include/llvm/CodeGen/FastISel.h:366:20: note:
overridden virtual function is here
  virtual unsigned fastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t
Imm);

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140930/e0816140/attachment.html>


More information about the llvm-bugs mailing list