From 62aa07c9153dfcf834a13d69b42046724ed56223 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 26 Sep 2020 16:30:28 -0700 Subject: [PATCH] arch,base,cpu,dev: Get rid of the M5_DUMMY_RETURN macro. This macro probably would have been defined to "return" in some cases, to be put after a call to a function that doesn't return so that the compiler wouldn't think control would reach the end of a non-void function. It was only ever defined to expand to nothing, and now that [[noreturn]] is a standard attribute, it should never be needed going forward. Change-Id: I37625eab72deeaede77f9347116b9fddd75febf7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35217 Reviewed-by: Daniel Carvalho Maintainer: Gabe Black Tested-by: kokoro --- src/arch/arm/utility.cc | 9 +++------ src/arch/mips/utility.cc | 1 - src/arch/sparc/utility.cc | 5 +---- src/base/compiler.hh | 1 - src/cpu/static_inst.cc | 2 -- src/dev/baddev.cc | 2 -- src/dev/mips/malta.hh | 3 --- src/dev/sparc/t1000.cc | 4 ---- 8 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc index a189c4aa9..4d866d09c 100644 --- a/src/arch/arm/utility.cc +++ b/src/arch/arm/utility.cc @@ -56,13 +56,10 @@ namespace ArmISA uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) { - if (!FullSystem) { - panic("getArgument() only implemented for full system mode.\n"); - M5_DUMMY_RETURN - } + panic_if(!FullSystem, + "getArgument() only implemented for full system mode."); - if (fp) - panic("getArgument(): Floating point arguments not implemented\n"); + panic_if(fp, "getArgument(): Floating point arguments not implemented"); if (inAArch64(tc)) { if (size == (uint16_t)(-1)) diff --git a/src/arch/mips/utility.cc b/src/arch/mips/utility.cc index 7e797b57f..930c36bcf 100644 --- a/src/arch/mips/utility.cc +++ b/src/arch/mips/utility.cc @@ -47,7 +47,6 @@ uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) { panic("getArgument() not implemented\n"); - M5_DUMMY_RETURN } uint64_t diff --git a/src/arch/sparc/utility.cc b/src/arch/sparc/utility.cc index 21fbf939d..66fabd1b8 100644 --- a/src/arch/sparc/utility.cc +++ b/src/arch/sparc/utility.cc @@ -43,10 +43,7 @@ namespace SparcISA { uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) { - if (!FullSystem) { - panic("getArgument() only implemented for full system\n"); - M5_DUMMY_RETURN - } + panic_if(!FullSystem, "getArgument() only implemented for full system"); const int NumArgumentRegs = 6; if (number < NumArgumentRegs) { diff --git a/src/base/compiler.hh b/src/base/compiler.hh index e2e777f9b..c3b2510a9 100644 --- a/src/base/compiler.hh +++ b/src/base/compiler.hh @@ -47,7 +47,6 @@ #if defined(__GNUC__) // clang or gcc # define M5_ATTR_NORETURN __attribute__((noreturn)) -# define M5_DUMMY_RETURN # define M5_VAR_USED __attribute__((unused)) # define M5_ATTR_PACKED __attribute__ ((__packed__)) # define M5_NO_INLINE __attribute__ ((__noinline__)) diff --git a/src/cpu/static_inst.cc b/src/cpu/static_inst.cc index f21d41bbc..7c6b0bfdc 100644 --- a/src/cpu/static_inst.cc +++ b/src/cpu/static_inst.cc @@ -106,7 +106,6 @@ StaticInst::branchTarget(const TheISA::PCState &pc) const { panic("StaticInst::branchTarget() called on instruction " "that is not a PC-relative branch."); - M5_DUMMY_RETURN; } TheISA::PCState @@ -114,7 +113,6 @@ StaticInst::branchTarget(ThreadContext *tc) const { panic("StaticInst::branchTarget() called on instruction " "that is not an indirect branch."); - M5_DUMMY_RETURN; } const string & diff --git a/src/dev/baddev.cc b/src/dev/baddev.cc index 9e28d3b4a..48cdff3fa 100644 --- a/src/dev/baddev.cc +++ b/src/dev/baddev.cc @@ -49,14 +49,12 @@ Tick BadDevice::read(PacketPtr pkt) { panic("Device %s not imlpmented\n", devname); - M5_DUMMY_RETURN } Tick BadDevice::write(PacketPtr pkt) { panic("Device %s not imlpmented\n", devname); - M5_DUMMY_RETURN } BadDevice * diff --git a/src/dev/mips/malta.hh b/src/dev/mips/malta.hh index d2bf584b9..d424dafa5 100644 --- a/src/dev/mips/malta.hh +++ b/src/dev/mips/malta.hh @@ -108,21 +108,18 @@ class Malta : public Platform calcPciConfigAddr(int bus, int dev, int func) { panic("Need implementation\n"); - M5_DUMMY_RETURN } Addr calcPciIOAddr(Addr addr) { panic("Need implementation\n"); - M5_DUMMY_RETURN } Addr calcPciMemAddr(Addr addr) { panic("Need implementation\n"); - M5_DUMMY_RETURN } void serialize(CheckpointOut &cp) const override; diff --git a/src/dev/sparc/t1000.cc b/src/dev/sparc/t1000.cc index 36a1666ec..6cf716a05 100644 --- a/src/dev/sparc/t1000.cc +++ b/src/dev/sparc/t1000.cc @@ -75,7 +75,6 @@ Addr T1000::pciToDma(Addr pciAddr) const { panic("Need implementation\n"); - M5_DUMMY_RETURN } @@ -83,21 +82,18 @@ Addr T1000::calcPciConfigAddr(int bus, int dev, int func) { panic("Need implementation\n"); - M5_DUMMY_RETURN } Addr T1000::calcPciIOAddr(Addr addr) { panic("Need implementation\n"); - M5_DUMMY_RETURN } Addr T1000::calcPciMemAddr(Addr addr) { panic("Need implementation\n"); - M5_DUMMY_RETURN } T1000 * -- 2.30.2