From 39c7e7d1eddc24ddddecd8abd7dbeae61f7959ac Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 4 Oct 2023 11:37:04 -0700 Subject: [PATCH 1/2] arch: Adding missing `override` to `PCState.set` As highlighed in this failing compiler test: https://github.com/gem5/gem5/actions/runs/6348223508/job/17389057995 Clang was failing when compiling "build/ALL/gem5.opt" due missing overrides in `PCState`'s "set" function. This was observed in Clang-14 and, stangely, Clang-8. Change-Id: I240c1087e8875fd07630e467e7452c62a5d14d5b --- src/arch/arm/pcstate.hh | 2 +- src/arch/generic/pcstate.hh | 4 ++-- src/arch/x86/pcstate.hh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arch/arm/pcstate.hh b/src/arch/arm/pcstate.hh index 7b75ed8184..a2f0463fab 100644 --- a/src/arch/arm/pcstate.hh +++ b/src/arch/arm/pcstate.hh @@ -92,7 +92,7 @@ class PCState : public GenericISA::UPCState<4> public: void - set(Addr val) + set(Addr val) override { Base::set(val); npc(val + (thumb() ? 2 : 4)); diff --git a/src/arch/generic/pcstate.hh b/src/arch/generic/pcstate.hh index 5c278a4233..25b3af69ea 100644 --- a/src/arch/generic/pcstate.hh +++ b/src/arch/generic/pcstate.hh @@ -489,7 +489,7 @@ class DelaySlotPCState : public SimplePCState void nnpc(Addr val) { _nnpc = val; } void - set(Addr val) + set(Addr val) override { Base::set(val); nnpc(val + 2 * InstWidth); @@ -563,7 +563,7 @@ class DelaySlotUPCState : public DelaySlotPCState } void - set(Addr val) + set(Addr val) override { Base::set(val); this->upc(0); diff --git a/src/arch/x86/pcstate.hh b/src/arch/x86/pcstate.hh index a0ed6ffe9f..95984d7a96 100644 --- a/src/arch/x86/pcstate.hh +++ b/src/arch/x86/pcstate.hh @@ -66,7 +66,7 @@ class PCState : public GenericISA::UPCState<8> } void - set(Addr val) + set(Addr val) override { Base::set(val); _size = 0; From 06bbc43b460a62597eadb55658f2bd77f42fcb00 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 5 Oct 2023 07:25:04 -0700 Subject: [PATCH 2/2] ext: Remove `std::binary_function` from DramPower `std::binary_function` was deprecated in C++11 and officially removed in CPP-17. This caused a compilation error on some systems. Fortunately it can be safely removed. It was unecessary. The commandItemSorter was compliant witih the `sort` regardless. Change-Id: I0d910e50c51cce2545dd89f618c99aef0fe8ab79 --- ext/drampower/src/CmdScheduler.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/drampower/src/CmdScheduler.h b/ext/drampower/src/CmdScheduler.h index 58efd279b1..1497304f54 100644 --- a/ext/drampower/src/CmdScheduler.h +++ b/ext/drampower/src/CmdScheduler.h @@ -84,8 +84,7 @@ class cmdScheduler { std::string name; physicalAddr PhysicalAddr; // sorting the commands according to their scheduling time. - struct commandItemSorter : public std::binary_function{ + struct commandItemSorter { bool operator()(const commandItem& lhs, const commandItem& rhs) const {