From 0acd2a96e5cd2a9bece4d5468dd1a8cc96c8aafe Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 19 Feb 2013 05:56:06 -0500 Subject: scons: Add warning for overloaded virtual functions A derived function with a different signature than a base class function will result in the base class function of the same name being hidden. The parameter list and return type for the member function in the derived class must match those of the member function in the base class, otherwise the function in the derived class will hide the function in the base class and no polymorphic behaviour will occur. This patch addresses these warnings by ensuring a unique function name to avoid (unintentionally) hiding any functions. --- src/arch/alpha/isa/branch.isa | 6 ++++++ src/arch/alpha/process.hh | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src/arch/alpha') diff --git a/src/arch/alpha/isa/branch.isa b/src/arch/alpha/isa/branch.isa index def6f3c1d..b60cb6d1e 100644 --- a/src/arch/alpha/isa/branch.isa +++ b/src/arch/alpha/isa/branch.isa @@ -83,6 +83,9 @@ output header {{ AlphaISA::PCState branchTarget(const AlphaISA::PCState &branchPC) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; @@ -108,6 +111,9 @@ output header {{ AlphaISA::PCState branchTarget(ThreadContext *tc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; diff --git a/src/arch/alpha/process.hh b/src/arch/alpha/process.hh index 40d6bf48a..8c8288341 100644 --- a/src/arch/alpha/process.hh +++ b/src/arch/alpha/process.hh @@ -49,6 +49,8 @@ class AlphaLiveProcess : public LiveProcess public: AlphaISA::IntReg getSyscallArg(ThreadContext *tc, int &i); + /// Explicitly import the otherwise hidden getSyscallArg + using LiveProcess::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; -- cgit v1.2.3