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 <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/arch/alpha/kernel_stats.hh b/src/arch/alpha/kernel_stats.hh
index 1bedeb0..c7a2ef1 100644
--- a/src/arch/alpha/kernel_stats.hh
+++ b/src/arch/alpha/kernel_stats.hh
@@ -81,7 +81,7 @@
   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 14214f1..b5064d4 100644
--- a/src/arch/alpha/linux/process.hh
+++ b/src/arch/alpha/linux/process.hh
@@ -46,7 +46,7 @@
 
     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<DefaultSyscallABI> syscallDescs[];
diff --git a/src/arch/mips/interrupts.hh b/src/arch/mips/interrupts.hh
index 02927ef..db8fe07 100644
--- a/src/arch/mips/interrupts.hh
+++ b/src/arch/mips/interrupts.hh
@@ -61,9 +61,7 @@
     {
     }
 
-    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 @@
     //  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 @@
     //  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 @@
     //  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 @@
     //  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 b2ab91e..f046757 100644
--- a/src/arch/mips/linux/process.hh
+++ b/src/arch/mips/linux/process.hh
@@ -44,7 +44,7 @@
     /// 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 60b38a1..bafe67a 100644
--- a/src/arch/power/linux/process.hh
+++ b/src/arch/power/linux/process.hh
@@ -43,13 +43,13 @@
   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 f746f11..b712cc8 100644
--- a/src/arch/power/process.hh
+++ b/src/arch/power/process.hh
@@ -46,14 +46,15 @@
   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 7a2ad28..224b2f0 100644
--- a/src/arch/riscv/linux/process.hh
+++ b/src/arch/riscv/linux/process.hh
@@ -48,7 +48,7 @@
     /// 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 @@
     /// 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 02f68d2..79a6f12 100644
--- a/src/arch/riscv/remote_gdb.hh
+++ b/src/arch/riscv/remote_gdb.hh
@@ -53,7 +53,7 @@
     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 @@
 
   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 58c7014..32b3c89 100644
--- a/src/arch/sparc/interrupts.hh
+++ b/src/arch/sparc/interrupts.hh
@@ -67,7 +67,7 @@
   public:
 
     void
-    setCPU(BaseCPU * _cpu)
+    setCPU(BaseCPU * _cpu) override
     {
         cpu = _cpu;
     }
@@ -100,7 +100,7 @@
     }
 
     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 @@
     }
 
     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 @@
     }
 
     void
-    clearAll()
+    clearAll() override
     {
         for (int i = 0; i < NumInterruptTypes; ++i) {
             interrupts[i] = 0;
@@ -132,7 +132,7 @@
     }
 
     bool
-    checkInterrupts(ThreadContext *tc) const
+    checkInterrupts(ThreadContext *tc) const override
     {
         if (!intStatus)
             return false;
@@ -190,7 +190,7 @@
     }
 
     Fault
-    getInterrupt(ThreadContext *tc)
+    getInterrupt(ThreadContext *tc) override
     {
         assert(checkInterrupts(tc));
 
@@ -246,9 +246,7 @@
         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 9b1fd06..68460a7 100644
--- a/src/arch/sparc/linux/process.hh
+++ b/src/arch/sparc/linux/process.hh
@@ -51,8 +51,8 @@
      /// indexed by call number.
     static SyscallDescABI<DefaultSyscallABI> 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 @@
     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 @@
     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 2e5379b..7ab362a 100644
--- a/src/arch/sparc/process.hh
+++ b/src/arch/sparc/process.hh
@@ -54,7 +54,7 @@
     SparcProcess(ProcessParams * params, ObjectFile *objFile,
                  Addr _StackBias);
 
-    void initState();
+    void initState() override;
 
     template<class IntType>
     void argsInit(int pageSize);
@@ -68,7 +68,8 @@
     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 @@
                                               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 @@
                                               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 424b0ec..e0d8033 100644
--- a/src/arch/sparc/solaris/process.hh
+++ b/src/arch/sparc/solaris/process.hh
@@ -45,7 +45,7 @@
     /// 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 5f3135d..3220b8b 100644
--- a/src/arch/x86/linux/process.hh
+++ b/src/arch/x86/linux/process.hh
@@ -56,7 +56,7 @@
     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 @@
     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