Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/9581 )

Change subject: base: Make bitunion output functions static/inline.
......................................................................

base: Make bitunion output functions static/inline.

The specializations need to be online only and not static, but the
template itself is static and inline.

Originally they were in an anonymous namespace, but that causes
warnings when building on clang or with certain versions of gcc because
the functions may not be used in every .cc.

Change-Id: Iff127337f7bf0c18755de07a49d6e7a9ce6f2f0a
Reviewed-on: https://gem5-review.googlesource.com/9581
Reviewed-by: Anthony Gutierrez <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Anthony Gutierrez <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/base/bitunion.hh
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved



diff --git a/src/base/bitunion.hh b/src/base/bitunion.hh
index b2a2ba8..49a956e 100644
--- a/src/base/bitunion.hh
+++ b/src/base/bitunion.hh
@@ -419,10 +419,9 @@

 namespace BitfieldBackend
 {
-namespace
-{
+
     template<typename T>
-    std::ostream &
+    static inline std::ostream &
     bitfieldBackendPrinter(std::ostream &os, const T &t)
     {
         os << t;
@@ -433,7 +432,7 @@
//these specializations attempt to ensure that they get cast to integers
     //of the appropriate type before printing.
     template <>
-    std::ostream &
+    inline std::ostream &
     bitfieldBackendPrinter(std::ostream &os, const char &t)
     {
         os << (const int)t;
@@ -441,14 +440,13 @@
     }

     template <>
-    std::ostream &
+    inline std::ostream &
     bitfieldBackendPrinter(std::ostream &os, const unsigned char &t)
     {
         os << (const unsigned int)t;
         return os;
     }
 }
-}

 //A default << operator which casts a bitunion to its underlying type and
 //passes it to BitfieldBackend::bitfieldBackendPrinter.

--
To view, visit https://gem5-review.googlesource.com/9581
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Iff127337f7bf0c18755de07a49d6e7a9ce6f2f0a
Gerrit-Change-Number: 9581
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Alexandru DuČ›u <[email protected]>
Gerrit-Reviewer: Anthony Gutierrez <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to