mem: Fix some reference use in range loops

This change fixes two cases of range loops, one where we can't use
lvalue reference, and one more where we have to use an lvalue
reference as we can't create a copy. In both cases clang would warn.

Change-Id: I760aa094af66be32a150bad37acc21d6fd512a65
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34776
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/mem/ruby/common/BoolVec.cc b/src/mem/ruby/common/BoolVec.cc
index 603f714..1c29532 100644
--- a/src/mem/ruby/common/BoolVec.cc
+++ b/src/mem/ruby/common/BoolVec.cc
@@ -41,8 +41,8 @@
 #include <vector>
 
 std::ostream& operator<<(std::ostream& os, const BoolVec& myvector) {
-    for (const auto& it: myvector) {
-        os << " " << it;
+    for (const bool e: myvector) {
+        os << " " << e;
     }
     return os;
 }
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
index 8ff8884..155d134 100644
--- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
+++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
@@ -256,8 +256,8 @@
 countBoolVec(BoolVec bVec)
 {
     int count = 0;
-    for (const auto &it: bVec) {
-        if (it) {
+    for (const bool e: bVec) {
+        if (e) {
             count++;
         }
     }
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index 75c58d6..dbc85c4 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -167,7 +167,7 @@
     int total_outstanding = 0;
 
     for (const auto &table_entry : m_RequestTable) {
-        for (const auto seq_req : table_entry.second) {
+        for (const auto &seq_req : table_entry.second) {
             if (current_time - seq_req.issue_time < m_deadlock_threshold)
                 continue;