arch-riscv,misc: Added M5_VAR_USED to MiscRegNames
authorBobby R. Bruce <bbruce@ucdavis.edu>
Mon, 25 May 2020 21:24:34 +0000 (14:24 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Wed, 27 May 2020 07:07:04 +0000 (07:07 +0000)
Clang compilers return an error about MiscRegNames being unused.
M5_VAR_USED fixes this.

Change-Id: I515c5d1e8837020b674de49039c0525f896b7e37
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29452
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/riscv/isa.cc

index ac26230a13cf9b2b09feb5f30a0109c36587a628..055c95b35225b60b2cbc84d2805fcd28b4dba047 100644 (file)
@@ -38,6 +38,7 @@
 #include "arch/riscv/pagetable.hh"
 #include "arch/riscv/registers.hh"
 #include "base/bitfield.hh"
+#include "base/compiler.hh"
 #include "cpu/base.hh"
 #include "debug/Checkpoint.hh"
 #include "debug/RiscvMisc.hh"
@@ -48,7 +49,7 @@
 namespace RiscvISA
 {
 
-const std::array<const char *, NumMiscRegs> MiscRegNames = {{
+const std::array<const char *, NumMiscRegs> M5_VAR_USED MiscRegNames = {{
     [MISCREG_PRV]           = "PRV",
     [MISCREG_ISA]           = "ISA",
     [MISCREG_VENDORID]      = "VENDORID",