From: Daniel R. Carvalho Date: Sun, 13 Dec 2020 13:54:14 +0000 (-0300) Subject: mem-ruby: Fix const copy of addr range in AbstractController X-Git-Tag: develop-gem5-snapshot~363 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c235d19b0eaea73f687ed1cbf63eeaee858f27f;p=gem5.git mem-ruby: Fix const copy of addr range in AbstractController Clang 10 throws the following error: loop variable 'addr_range' of type 'const AddrRange' creates a copy from type 'const AddrRange' [-Werror,-Wrange-loop-construct] note: use reference type 'const AddrRange &' to prevent copying Issue introduced by c7fabb979c09864ab47ae848381d6797b45a4cc6. Change-Id: I43e8d613eb5069d5ce9cb12ddec18cba0a3847f6 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38495 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Tested-by: kokoro --- diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index 1e8d8e09f..ba2075a0d 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -87,7 +87,7 @@ AbstractController::init() for (auto abs_cntrl : params().downstream_destinations) { MachineID mid = abs_cntrl->getMachineID(); const AddrRangeList &ranges = abs_cntrl->getAddrRanges(); - for (const auto addr_range : ranges) { + for (const auto &addr_range : ranges) { auto i = downstreamAddrMap.intersects(addr_range); if (i == downstreamAddrMap.end()) { i = downstreamAddrMap.insert(addr_range, AddrMapEntry());