summaryrefslogtreecommitdiff
path: root/src/arch/mips/faults.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-05-18 15:11:23 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-05-19 08:00:45 +0000
commitc4b85d5f9854abeee6d1dbe15ae65a7a1aada6b2 (patch)
tree521b54e172ab547cd2147502bdb0015be924bb73 /src/arch/mips/faults.hh
parent41ab3e6e7e9b5a5f4427949f9a981cdf2186c88a (diff)
downloadgem5-c4b85d5f9854abeee6d1dbe15ae65a7a1aada6b2.tar.xz
base, sim, arch: Fix clang 5.0 warnings
Compiling gem5 with recent version of clang (4 and 5) triggers warnings that are treated as errors: * Global templatized static functions result in a warning if they are not used. These should either be declared as static inline or without the static identifier to avoid the warning. * Some templatized classes contain static variables. The instantiated versions of these variables / templates need to be explicitly declared to avoid a compiler warning. Change-Id: Ie8261144836e94ebab7ea04ccccb90927672c257 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/3420 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/mips/faults.hh')
-rw-r--r--src/arch/mips/faults.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/arch/mips/faults.hh b/src/arch/mips/faults.hh
index 1ec726d17..dcce764ca 100644
--- a/src/arch/mips/faults.hh
+++ b/src/arch/mips/faults.hh
@@ -303,6 +303,30 @@ class TlbModifiedFault : public TlbFault<TlbModifiedFault>
ExcCode code() const { return MipsFault<TlbModifiedFault>::code(); }
};
+/*
+ * Explicitly declare template static member variables to avoid warnings
+ * in some clang versions
+ */
+template<> MipsFaultBase::FaultVals MipsFault<SystemCallFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<ReservedInstructionFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<ThreadFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<IntegerOverflowFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<TrapFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<BreakpointFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<DspStateDisabledFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<MachineCheckFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<ResetFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<SoftResetFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<NonMaskableInterrupt>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<CoprocessorUnusableFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<InterruptFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<AddressErrorFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<TlbInvalidFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<TlbRefillFault>::vals;
+template<> MipsFaultBase::FaultVals MipsFault<TlbModifiedFault>::vals;
+
+
+
} // namespace MipsISA
#endif // __MIPS_FAULTS_HH__