From 4aa277a8652b3d33cc4372d4fd326ba3f55e2a24 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 9 Feb 2020 17:56:14 -0800 Subject: [PATCH] arch: Add a bunch of missing override specifiers. Missing override on methods which are overriding virtual methods causes warnings/errors on certain compilers. Change-Id: I16f565fa07bfcb399a0209cd87f1f9729cd89b2e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25223 Reviewed-by: Giacomo Travaglini Maintainer: Gabe Black Tested-by: kokoro --- src/arch/alpha/kernel_stats.hh | 2 +- src/arch/alpha/linux/process.hh | 2 +- src/arch/mips/interrupts.hh | 16 +++++++--------- src/arch/mips/linux/process.hh | 2 +- src/arch/power/linux/process.hh | 6 +++--- src/arch/power/process.hh | 7 ++++--- src/arch/riscv/linux/process.hh | 4 ++-- src/arch/riscv/remote_gdb.hh | 4 ++-- src/arch/sparc/interrupts.hh | 16 +++++++--------- src/arch/sparc/linux/process.hh | 12 ++++++------ src/arch/sparc/process.hh | 17 +++++++++-------- src/arch/sparc/solaris/process.hh | 2 +- src/arch/x86/linux/process.hh | 4 ++-- 13 files changed, 46 insertions(+), 48 deletions(-) diff --git a/src/arch/alpha/kernel_stats.hh b/src/arch/alpha/kernel_stats.hh index 1bedeb0e6..c7a2ef16c 100644 --- a/src/arch/alpha/kernel_stats.hh +++ b/src/arch/alpha/kernel_stats.hh @@ -81,7 +81,7 @@ class Statistics : public ::Kernel::Statistics public: Statistics(); - void regStats(const std::string &name); + void regStats(const std::string &name) override; public: void mode(cpu_mode newmode, ThreadContext *tc); diff --git a/src/arch/alpha/linux/process.hh b/src/arch/alpha/linux/process.hh index 14214f187..b5064d44f 100644 --- a/src/arch/alpha/linux/process.hh +++ b/src/arch/alpha/linux/process.hh @@ -46,7 +46,7 @@ class AlphaLinuxProcess : public AlphaProcess void syscall(ThreadContext *tc, Fault *fault) override; - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc *getDesc(int callnum) override; /// Array of syscall descriptors, indexed by call number. static SyscallDescABI syscallDescs[]; diff --git a/src/arch/mips/interrupts.hh b/src/arch/mips/interrupts.hh index 02927ef2a..db8fe0706 100644 --- a/src/arch/mips/interrupts.hh +++ b/src/arch/mips/interrupts.hh @@ -61,9 +61,7 @@ class Interrupts : public BaseInterrupts { } - void - setCPU(BaseCPU *_cpu) - {} + void setCPU(BaseCPU *_cpu) override {} // post(int int_num, int index) is responsible // for posting an interrupt. It sets a bit @@ -72,7 +70,7 @@ class Interrupts : public BaseInterrupts // which is called by checkInterrupts // void post(int int_num, ThreadContext *tc); - void post(int int_num, int index); + void post(int int_num, int index) override; // clear(int int_num, int index) is responsible // for clearing an interrupt. It clear a bit @@ -81,7 +79,7 @@ class Interrupts : public BaseInterrupts // which is called by checkInterrupts // void clear(int int_num, ThreadContext* tc); - void clear(int int_num, int index); + void clear(int int_num, int index) override; // clearAll() is responsible // for clearing all interrupts. It clears all bits @@ -90,7 +88,7 @@ class Interrupts : public BaseInterrupts // which is called by checkInterrupts // void clearAll(ThreadContext *tc); - void clearAll(); + void clearAll() override; // getInterrupt(ThreadContext * tc) checks if an interrupt // should be returned. It ands the interrupt mask and @@ -98,16 +96,16 @@ class Interrupts : public BaseInterrupts // also makes sure interrupts are enabled (IE) and // that ERL and ERX are not set // - Fault getInterrupt(ThreadContext *tc); + Fault getInterrupt(ThreadContext *tc) override; // updateIntrInfo(ThreadContext *tc) const syncs the // MIPS cause register with the instatus variable. instatus // is essentially a copy of the MIPS cause[IP7:IP0] // - void updateIntrInfo(ThreadContext *tc); + void updateIntrInfo(ThreadContext *tc) override; bool interruptsPending(ThreadContext *tc) const; bool onCpuTimerInterrupt(ThreadContext *tc) const; - bool checkInterrupts(ThreadContext *tc) const; + bool checkInterrupts(ThreadContext *tc) const override; void serialize(CheckpointOut &cp) const override diff --git a/src/arch/mips/linux/process.hh b/src/arch/mips/linux/process.hh index b2ab91e16..f0467576f 100644 --- a/src/arch/mips/linux/process.hh +++ b/src/arch/mips/linux/process.hh @@ -44,7 +44,7 @@ class MipsLinuxProcess : public MipsProcess /// Constructor. MipsLinuxProcess(ProcessParams * params, ObjectFile *objFile); - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc* getDesc(int callnum) override; /// The target system's hostname. static const char *hostname; diff --git a/src/arch/power/linux/process.hh b/src/arch/power/linux/process.hh index 60b38a152..bafe67a45 100644 --- a/src/arch/power/linux/process.hh +++ b/src/arch/power/linux/process.hh @@ -43,13 +43,13 @@ class PowerLinuxProcess : public PowerProcess public: PowerLinuxProcess(ProcessParams * params, ObjectFile *objFile); - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc *getDesc(int callnum) override; - void initState(); + void initState() override; void syscall(ThreadContext *tc, Fault *fault) override; - RegVal getSyscallArg(ThreadContext *tc, int &i); + RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; diff --git a/src/arch/power/process.hh b/src/arch/power/process.hh index f746f1155..b712cc8ef 100644 --- a/src/arch/power/process.hh +++ b/src/arch/power/process.hh @@ -46,14 +46,15 @@ class PowerProcess : public Process protected: PowerProcess(ProcessParams * params, ObjectFile *objFile); - void initState(); + void initState() override; public: void argsInit(int intSize, int pageSize); - RegVal getSyscallArg(ThreadContext *tc, int &i); + RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); + void setSyscallReturn(ThreadContext *tc, + SyscallReturn return_value) override; }; #endif // __POWER_PROCESS_HH__ diff --git a/src/arch/riscv/linux/process.hh b/src/arch/riscv/linux/process.hh index 7a2ad280e..224b2f049 100644 --- a/src/arch/riscv/linux/process.hh +++ b/src/arch/riscv/linux/process.hh @@ -48,7 +48,7 @@ class RiscvLinuxProcess64 : public RiscvProcess64 /// Constructor. RiscvLinuxProcess64(ProcessParams * params, ObjectFile *objFile); - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc* getDesc(int callnum) override; /// The target system's hostname. static const char *hostname; @@ -68,7 +68,7 @@ class RiscvLinuxProcess32 : public RiscvProcess32 /// Constructor. RiscvLinuxProcess32(ProcessParams * params, ObjectFile *objFile); - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc* getDesc(int callnum) override; /// The target system's hostname. static const char *hostname; diff --git a/src/arch/riscv/remote_gdb.hh b/src/arch/riscv/remote_gdb.hh index 02f68d2b2..79a6f126b 100644 --- a/src/arch/riscv/remote_gdb.hh +++ b/src/arch/riscv/remote_gdb.hh @@ -53,7 +53,7 @@ class RemoteGDB : public BaseRemoteGDB static const int NumGDBRegs = 4162; static const int NumCSRs = 4096; - bool acc(Addr addr, size_t len); + bool acc(Addr addr, size_t len) override; // A breakpoint will be 2 bytes if it is compressed and 4 if not bool checkBpLen(size_t len) override { return len == 2 || len == 4; } @@ -82,7 +82,7 @@ class RemoteGDB : public BaseRemoteGDB public: RemoteGDB(System *_system, ThreadContext *tc, int _port); - BaseGdbRegCache *gdbRegs(); + BaseGdbRegCache *gdbRegs() override; }; } // namespace RiscvISA diff --git a/src/arch/sparc/interrupts.hh b/src/arch/sparc/interrupts.hh index 58c701477..32b3c8920 100644 --- a/src/arch/sparc/interrupts.hh +++ b/src/arch/sparc/interrupts.hh @@ -67,7 +67,7 @@ class Interrupts : public BaseInterrupts public: void - setCPU(BaseCPU * _cpu) + setCPU(BaseCPU * _cpu) override { cpu = _cpu; } @@ -100,7 +100,7 @@ class Interrupts : public BaseInterrupts } void - post(int int_num, int index) + post(int int_num, int index) override { DPRINTF(Interrupt, "Interrupt %d:%d posted\n", int_num, index); assert(int_num >= 0 && int_num < NumInterruptTypes); @@ -111,7 +111,7 @@ class Interrupts : public BaseInterrupts } void - clear(int int_num, int index) + clear(int int_num, int index) override { DPRINTF(Interrupt, "Interrupt %d:%d cleared\n", int_num, index); assert(int_num >= 0 && int_num < NumInterruptTypes); @@ -123,7 +123,7 @@ class Interrupts : public BaseInterrupts } void - clearAll() + clearAll() override { for (int i = 0; i < NumInterruptTypes; ++i) { interrupts[i] = 0; @@ -132,7 +132,7 @@ class Interrupts : public BaseInterrupts } bool - checkInterrupts(ThreadContext *tc) const + checkInterrupts(ThreadContext *tc) const override { if (!intStatus) return false; @@ -190,7 +190,7 @@ class Interrupts : public BaseInterrupts } Fault - getInterrupt(ThreadContext *tc) + getInterrupt(ThreadContext *tc) override { assert(checkInterrupts(tc)); @@ -246,9 +246,7 @@ class Interrupts : public BaseInterrupts return NoFault; } - void - updateIntrInfo(ThreadContext *tc) - {} + void updateIntrInfo(ThreadContext *tc) override {} uint64_t get_vec(int int_num) diff --git a/src/arch/sparc/linux/process.hh b/src/arch/sparc/linux/process.hh index 9b1fd065f..68460a798 100644 --- a/src/arch/sparc/linux/process.hh +++ b/src/arch/sparc/linux/process.hh @@ -51,8 +51,8 @@ class SparcLinuxProcess /// indexed by call number. static SyscallDescABI syscall32Descs[]; - SyscallDesc* getDesc(int callnum); - SyscallDesc* getDesc32(int callnum); + SyscallDesc *getDesc(int callnum); + SyscallDesc *getDesc32(int callnum); static const int Num_Syscall_Descs; static const int Num_Syscall32_Descs; @@ -66,14 +66,14 @@ class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32Process Sparc32LinuxProcess(ProcessParams * params, ObjectFile *objFile); SyscallDesc* - getDesc(int callnum) + getDesc(int callnum) override { return SparcLinuxProcess::getDesc32(callnum); } void syscall(ThreadContext *tc, Fault *fault) override; - void handleTrap(int trapNum, ThreadContext *tc, Fault *fault); + void handleTrap(int trapNum, ThreadContext *tc, Fault *fault) override; }; /// A process with emulated 32 bit SPARC/Linux syscalls. @@ -84,14 +84,14 @@ class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64Process Sparc64LinuxProcess(ProcessParams * params, ObjectFile *objFile); SyscallDesc* - getDesc(int callnum) + getDesc(int callnum) override { return SparcLinuxProcess::getDesc(callnum); } void syscall(ThreadContext *tc, Fault *fault) override; - void handleTrap(int trapNum, ThreadContext *tc, Fault *fault); + void handleTrap(int trapNum, ThreadContext *tc, Fault *fault) override; }; SyscallReturn getresuidFunc(SyscallDesc *desc, int num, ThreadContext *tc); diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 2e5379bc5..7ab362aae 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -54,7 +54,7 @@ class SparcProcess : public Process SparcProcess(ProcessParams * params, ObjectFile *objFile, Addr _StackBias); - void initState(); + void initState() override; template void argsInit(int pageSize); @@ -68,7 +68,8 @@ class SparcProcess : public Process Addr readSpillStart() { return spillStart; } virtual void flushWindows(ThreadContext *tc) = 0; - void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); + void setSyscallReturn(ThreadContext *tc, + SyscallReturn return_value) override; }; class Sparc32Process : public SparcProcess @@ -100,15 +101,15 @@ class Sparc32Process : public SparcProcess mmap_end); } - void initState(); + void initState() override; public: void argsInit(int intSize, int pageSize); - void flushWindows(ThreadContext *tc); + void flushWindows(ThreadContext *tc) override; - RegVal getSyscallArg(ThreadContext *tc, int &i); + RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; }; @@ -141,15 +142,15 @@ class Sparc64Process : public SparcProcess mmap_end); } - void initState(); + void initState() override; public: void argsInit(int intSize, int pageSize); - void flushWindows(ThreadContext *tc); + void flushWindows(ThreadContext *tc) override; - RegVal getSyscallArg(ThreadContext *tc, int &i); + RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; }; diff --git a/src/arch/sparc/solaris/process.hh b/src/arch/sparc/solaris/process.hh index 424b0ec60..e0d803373 100644 --- a/src/arch/sparc/solaris/process.hh +++ b/src/arch/sparc/solaris/process.hh @@ -45,7 +45,7 @@ class SparcSolarisProcess : public Sparc64Process /// Constructor. SparcSolarisProcess(ProcessParams * params, ObjectFile *objFile); - virtual SyscallDesc* getDesc(int callnum); + SyscallDesc *getDesc(int callnum) override; /// The target system's hostname. static const char *hostname; diff --git a/src/arch/x86/linux/process.hh b/src/arch/x86/linux/process.hh index 5f3135dd9..3220b8ba3 100644 --- a/src/arch/x86/linux/process.hh +++ b/src/arch/x86/linux/process.hh @@ -56,7 +56,7 @@ class X86_64LinuxProcess : public X86_64Process X86_64LinuxProcess(ProcessParams * params, ObjectFile *objFile); void syscall(ThreadContext *tc, Fault *fault) override; void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, - RegVal flags); + RegVal flags) override; }; class I386LinuxProcess : public I386Process @@ -66,7 +66,7 @@ class I386LinuxProcess : public I386Process I386LinuxProcess(ProcessParams * params, ObjectFile *objFile); void syscall(ThreadContext *tc, Fault *fault) override; void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, - RegVal flags); + RegVal flags) override; }; } // namespace X86ISA -- 2.30.2