From 2ac04c11accb46f92cf7f2b7abe40404dbf8c5d6 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 12 Oct 2015 04:08:01 -0400 Subject: misc: Add explicit overrides and fix other clang >= 3.5 issues This patch adds explicit overrides as this is now required when using "-Wall" with clang >= 3.5, the latter now part of the most recent XCode. The patch consequently removes "virtual" for those methods where "override" is added. The latter should be enough of an indication. As part of this patch, a few minor issues that clang >= 3.5 complains about are also resolved (unused methods and variables). --- src/cpu/simple/atomic.hh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/cpu/simple/atomic.hh') diff --git a/src/cpu/simple/atomic.hh b/src/cpu/simple/atomic.hh index 372df7cbd..1a2f19949 100644 --- a/src/cpu/simple/atomic.hh +++ b/src/cpu/simple/atomic.hh @@ -55,7 +55,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU AtomicSimpleCPU(AtomicSimpleCPUParams *params); virtual ~AtomicSimpleCPU(); - virtual void init(); + void init() override; private: @@ -181,10 +181,10 @@ class AtomicSimpleCPU : public BaseSimpleCPU protected: /** Return a reference to the data port. */ - virtual MasterPort &getDataPort() { return dcachePort; } + MasterPort &getDataPort() override { return dcachePort; } /** Return a reference to the instruction port. */ - virtual MasterPort &getInstPort() { return icachePort; } + MasterPort &getInstPort() override { return icachePort; } /** Perform snoop for other cpu-local thread contexts. */ void threadSnoop(PacketPtr pkt, ThreadID sender); @@ -194,20 +194,21 @@ class AtomicSimpleCPU : public BaseSimpleCPU DrainState drain() override; void drainResume() override; - void switchOut(); - void takeOverFrom(BaseCPU *oldCPU); + void switchOut() override; + void takeOverFrom(BaseCPU *oldCPU) override; - void verifyMemoryMode() const; + void verifyMemoryMode() const override; - virtual void activateContext(ThreadID thread_num); - virtual void suspendContext(ThreadID thread_num); + void activateContext(ThreadID thread_num) override; + void suspendContext(ThreadID thread_num) override; - Fault readMem(Addr addr, uint8_t *data, unsigned size, unsigned flags); + Fault readMem(Addr addr, uint8_t *data, unsigned size, + unsigned flags) override; Fault writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res); + Addr addr, unsigned flags, uint64_t *res) override; - virtual void regProbePoints(); + void regProbePoints() override; /** * Print state of address in memory system via PrintReq (for -- cgit v1.2.3