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/power/insts/branch.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/arch/power/insts') diff --git a/src/arch/power/insts/branch.hh b/src/arch/power/insts/branch.hh index 1947e4ec3..762e55a66 100644 --- a/src/arch/power/insts/branch.hh +++ b/src/arch/power/insts/branch.hh @@ -88,6 +88,9 @@ class BranchPCRel : public PCDependentDisassembly PowerISA::PCState branchTarget(const PowerISA::PCState &pc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; @@ -114,6 +117,9 @@ class BranchNonPCRel : public PCDependentDisassembly PowerISA::PCState branchTarget(const PowerISA::PCState &pc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; @@ -189,6 +195,9 @@ class BranchPCRelCond : public BranchCond PowerISA::PCState branchTarget(const PowerISA::PCState &pc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; @@ -215,6 +224,9 @@ class BranchNonPCRelCond : public BranchCond PowerISA::PCState branchTarget(const PowerISA::PCState &pc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; @@ -233,6 +245,9 @@ class BranchRegCond : public BranchCond PowerISA::PCState branchTarget(ThreadContext *tc) const; + /// Explicitly import the otherwise hidden branchTarget + using StaticInst::branchTarget; + std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; -- cgit v1.2.3