Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/50346 )

Change subject: base: Fix some style problems in addr_range.hh.
......................................................................

base: Fix some style problems in addr_range.hh.

Change-Id: Ib55b86350c4bc3f1f44af996db25a1e44826d077
---
M src/base/addr_range.hh
1 file changed, 42 insertions(+), 21 deletions(-)



diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh
index 90d9279..3fce412 100644
--- a/src/base/addr_range.hh
+++ b/src/base/addr_range.hh
@@ -288,7 +288,8 @@
      *
      * @ingroup api_addr_range
      */
-    uint64_t granularity() const
+    uint64_t
+    granularity() const
     {
         if (interleaved()) {
             auto combined_mask = 0;
@@ -319,7 +320,8 @@
      *
      * @ingroup api_addr_range
      */
-    Addr size() const
+    Addr
+    size() const
     {
         return (_end - _start) >> masks.size();
     }
@@ -352,7 +354,8 @@
      *
      * @ingroup api_addr_range
      */
-    std::string to_string() const
+    std::string
+    to_string() const
     {
         if (interleaved()) {
             std::string str;
@@ -382,7 +385,8 @@
      *
      * @ingroup api_addr_range
      */
-    bool mergesWith(const AddrRange& r) const
+    bool
+    mergesWith(const AddrRange& r) const
     {
         return r._start == _start && r._end == _end &&
             r.masks == masks;
@@ -398,28 +402,31 @@
      *
      * @ingroup api_addr_range
      */
-    bool intersects(const AddrRange& r) const
+    bool
+    intersects(const AddrRange& r) const
     {
-        if (_start >= r._end || _end <= r._start)
+        if (_start >= r._end || _end <= r._start) {
             // start with the simple case of no overlap at all,
             // applicable even if we have interleaved ranges
             return false;
-        else if (!interleaved() && !r.interleaved())
+        } else if (!interleaved() && !r.interleaved()) {
             // if neither range is interleaved, we are done
             return true;
+        }

         // now it gets complicated, focus on the cases we care about
-        if (r.size() == 1)
+        if (r.size() == 1) {
             // keep it simple and check if the address is within
             // this range
             return contains(r.start());
-        else if (mergesWith(r))
+        } else if (mergesWith(r)) {
             // restrict the check to ranges that belong to the
             // same chunk
             return intlvMatch == r.intlvMatch;
-        else
+        } else {
             panic("Cannot test intersection of %s and %s\n",
                   to_string(), r.to_string());
+        }
     }

     /**
@@ -432,7 +439,8 @@
      *
      * @ingroup api_addr_range
      */
-    bool isSubset(const AddrRange& r) const
+    bool
+    isSubset(const AddrRange& r) const
     {
         if (interleaved())
panic("Cannot test subset of interleaved range %s\n", to_string());
@@ -457,7 +465,8 @@
      *
      * @ingroup api_addr_range
      */
-    bool contains(const Addr& a) const
+    bool
+    contains(const Addr& a) const
     {
         // check if the address is in the range and if there is either
         // no interleaving, or with interleaving also if the selected
@@ -502,7 +511,8 @@
      *
      * @ingroup api_addr_range
      */
-    inline Addr removeIntlvBits(Addr a) const
+    inline Addr
+    removeIntlvBits(Addr a) const
     {
         // Directly return the address if the range is not interleaved
         // to prevent undefined behavior.
@@ -540,7 +550,8 @@
      *
      * @ingroup api_addr_range
      */
-    inline Addr addIntlvBits(Addr a) const
+    inline Addr
+    addIntlvBits(Addr a) const
     {
         // Directly return the address if the range is not interleaved
         // to prevent undefined behavior.
@@ -594,7 +605,8 @@
      *
      * @ingroup api_addr_range
      */
-    Addr getOffset(const Addr& a) const
+    Addr
+    getOffset(const Addr& a) const
     {
         bool in_range = a >= _start && a < _end;
         if (!in_range) {
@@ -672,7 +684,8 @@
      *
      * @ingroup api_addr_range
      */
-    bool operator<(const AddrRange& r) const
+    bool
+    operator<(const AddrRange& r) const
     {
         if (_start != r._start) {
             return _start < r._start;
@@ -692,7 +705,8 @@
     /**
      * @ingroup api_addr_range
      */
-    bool operator==(const AddrRange& r) const
+    bool
+    operator==(const AddrRange& r) const
     {
         if (_start != r._start)    return false;
         if (_end != r._end)      return false;
@@ -705,7 +719,8 @@
     /**
      * @ingroup api_addr_range
      */
-    bool operator!=(const AddrRange& r) const
+    bool
+    operator!=(const AddrRange& r) const
     {
         return !(*this == r);
     }
@@ -716,21 +731,27 @@
  */
 inline AddrRange
 RangeEx(Addr start, Addr end)
-{ return AddrRange(start, end); }
+{
+    return AddrRange(start, end);
+}

 /**
  * @ingroup api_addr_range
  */
 inline AddrRange
 RangeIn(Addr start, Addr end)
-{ return AddrRange(start, end + 1); }
+{
+    return AddrRange(start, end + 1);
+}

 /**
  * @ingroup api_addr_range
  */
 inline AddrRange
 RangeSize(Addr start, Addr size)
-{ return AddrRange(start, start + size); }
+{
+    return AddrRange(start, start + size);
+}

 } // namespace gem5


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50346
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: Ib55b86350c4bc3f1f44af996db25a1e44826d077
Gerrit-Change-Number: 50346
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
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

Reply via email to