Daniel Carvalho has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/38737 )
Change subject: base: Rename Flags::update as Flags::replace
......................................................................
base: Rename Flags::update as Flags::replace
The function name `update` is too generic. Given that
the expected functionality is to replace the selected
flag bits with the bits provided as parameters, rename
it as `replace`.
Change-Id: Ic7613ae09ecf9b92e31103b4e928192c07e9b640
Signed-off-by: Daniel R. Carvalho <oda...@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38737
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Bobby R. Bruce <bbr...@ucdavis.edu>
---
M src/base/flags.hh
M src/base/flags.test.cc
2 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved
Bobby R. Bruce: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/flags.hh b/src/base/flags.hh
index 6e82210..0544380 100644
--- a/src/base/flags.hh
+++ b/src/base/flags.hh
@@ -135,7 +135,7 @@
* @param mask Mask used to determine which bits are replaced.
*/
void
- update(Type flags, Type mask)
+ replace(Type flags, Type mask)
{
_flags = (_flags & ~mask) | (flags & mask);
}
diff --git a/src/base/flags.test.cc b/src/base/flags.test.cc
index c45a7a8..08031b9 100644
--- a/src/base/flags.test.cc
+++ b/src/base/flags.test.cc
@@ -192,11 +192,11 @@
}
/**
- * Test updating a masked selection of bits. This means that bits of the
+ * Test replacing a masked selection of bits. This means that bits of the
* original value that match the mask will be replaced by the bits of
* the new value that match the mask.
*/
-TEST(FlagsTest, UpdateOverlapping)
+TEST(FlagsTest, ReplaceOverlapping)
{
const uint32_t value_a = (1 << 4) | (1 << 5) | (1 << 6);
const uint32_t value_b = (1 << 3) | (1 << 5) | (1 << 9);
@@ -207,6 +207,6 @@
// (1 << 10) is not set in both values, so it remains not set
const uint32_t result = (1 << 5) | (1 << 6) | (1 << 9);
Flags<uint32_t> flags(value_a);
- flags.update(value_b, mask);
+ flags.replace(value_b, mask);
ASSERT_EQ(result, uint32_t(flags));
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38737
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: Ic7613ae09ecf9b92e31103b4e928192c07e9b640
Gerrit-Change-Number: 38737
Gerrit-PatchSet: 6
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s