Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/48514 )
Change subject: sim,base: Deprecate the GEM5_DEPRECATED_ENUM_VAL attribute.
......................................................................
sim,base: Deprecate the GEM5_DEPRECATED_ENUM_VAL attribute.
The deprecated attribute didn't work on versions of gcc older than 6,
but we now require version 7 or newer, so we don't need the macro any
more.
This change collapses the two uses of it in sim/aux_vector.hh, and marks
the macro as deprecated by extending the message string in the
underlying deprecated attribute.
Change-Id: I3bc9835ba19ad9534c7725e17a3558a749a94ca5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48514
Tested-by: kokoro <[email protected]>
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Daniel Carvalho <[email protected]>
---
M src/base/compiler.hh
M src/sim/aux_vector.hh
2 files changed, 8 insertions(+), 14 deletions(-)
Approvals:
Daniel Carvalho: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/compiler.hh b/src/base/compiler.hh
index 36aa13e..29375c1 100644
--- a/src/base/compiler.hh
+++ b/src/base/compiler.hh
@@ -80,16 +80,6 @@
# define GEM5_LIKELY(cond) __builtin_expect(!!(cond), 1)
# define GEM5_UNLIKELY(cond) __builtin_expect(!!(cond), 0)
-// Mark a C++ emum value as deprecated, with a message explaining what to
do
-// to update to a non-deprecated alternative. This wraps GEM5_DEPRECATED
but
-// is guarded by a preprocessor if directive to ensure it is not included
-// when compiled in GCC < 6, as deprecation of enum values was introduced
in
-// GCC 6. All supported clang compilers allow enum value deprecation.
-# if defined(__clang__) || __GNUC__ >= 6
-# define GEM5_DEPRECATED_ENUM_VAL(message) [[deprecated(message)]]
-# else
-# define GEM5_DEPRECATED_ENUM_VAL(message)
-# endif
// Mark an expression-like macro as deprecated by wrapping it in some code
// which declares and uses a deprecated variable with the same name as the
// macro. The wrapping macro evaluates to the same thing as the original
macro.
@@ -173,6 +163,10 @@
#define GEM5_DEPRECATED(message) \
[[deprecated(message " The GEM5_DEPRECATED macro is also
deprecated, "\
"please use the [[deprecated()]] attribute directly.")]]
+#define GEM5_DEPRECATED_ENUM_VAL(message) \
+ [[deprecated(message " The GEM5_DEPRECATED_ENUM_VAL macro is also "\
+ "deprecated, please use the [[deprecated()]] attribute "\
+ "directly.")]]
// Deprecated attributes which can't be made to warn without possibly
breaking
// existing code.
diff --git a/src/sim/aux_vector.hh b/src/sim/aux_vector.hh
index 0a14eff..bc100c5 100644
--- a/src/sim/aux_vector.hh
+++ b/src/sim/aux_vector.hh
@@ -95,8 +95,8 @@
} // namespace auxv
#define GEM5_DEPRECATE_AT(NAME, name) M5_AT_##NAME \
- GEM5_DEPRECATED_ENUM_VAL(\
- "Replace M5_AT_" #NAME " with gem5::auxv::" #name) =
gem5::auxv::name
+ [[deprecated("Replace M5_AT_" #NAME " with gem5::auxv::" #name)]] = \
+ gem5::auxv::name
enum AuxiliaryVectorType
{
@@ -119,8 +119,8 @@
GEM5_DEPRECATE_AT(HWCAP, Hwcap),
GEM5_DEPRECATE_AT(CLKTCK, Clktck),
GEM5_DEPRECATE_AT(SECURE, Secure),
- M5_BASE_PLATFORM GEM5_DEPRECATED_ENUM_VAL(
- "Replace M5_BASE_PLATFORM with gem5::auxv::BasePlatform") =
+ M5_BASE_PLATFORM [[deprecated(
+ "Replace M5_BASE_PLATFORM with gem5::auxv::BasePlatform")]] =
gem5::auxv::BasePlatform,
GEM5_DEPRECATE_AT(RANDOM, Random),
GEM5_DEPRECATE_AT(HWCAP2, Hwcap2),
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48514
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3bc9835ba19ad9534c7725e17a3558a749a94ca5
Gerrit-Change-Number: 48514
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s